INTERVIEW QUESTION - Conversion of two list into Dictionary Using Python

Sdílet
Vložit
  • čas přidán 22. 01. 2020
  • INTERVIEW QUESTION - Conversion of two list into Dictionary Using Python
    GitHub Link:- github.com/netsetos/python_co...
    ~-~~-~~~-~~-~
    Please watch: "LRU Cache (With Python Code) "
    • LRU Cache Implementati...
    ~-~~-~~~-~~-~

Komentáře • 18

  • @srisangeeth4131
    @srisangeeth4131 Před 7 dny

    Your Tutorials about python interview questions are really fantastic ,I understood well and i done with my own examples.If dictionary to list what can we do??

  • @sreevasudhavalli
    @sreevasudhavalli Před rokem +1

    Much apperciated. Love your work

  • @sharmishthadevi7637
    @sharmishthadevi7637 Před 3 lety +1

    Awesome video

  • @techiewithcamera
    @techiewithcamera Před 11 měsíci +8

    My Solution:
    def list_to_dict(list1, list2):
    dict={}
    for i in range(len(list1)):
    dict[list1[i]]=list2[i]
    print(dict)

    • @sonusah6620
      @sonusah6620 Před 8 měsíci

      Thank you for the amazing solution

  • @khetrabasitechvideo362
    @khetrabasitechvideo362 Před 2 lety +1

    Wow ❤️

  • @vishalsharma_369
    @vishalsharma_369 Před 11 měsíci

    Thank you

  • @sindhuswrp
    @sindhuswrp Před 26 dny +1

    dict = {key:value for (key, value) in zip(list1, list2)}

  • @cinephile4371
    @cinephile4371 Před 3 lety +3

    very useful ...do more videos

  • @shaikjaffershareef448
    @shaikjaffershareef448 Před 2 měsíci

    what is zip fuction and how it works

  • @Didffjbjgha6963
    @Didffjbjgha6963 Před 6 měsíci +2

    def list_do_list():
    x=[1,2,3]
    y=["one","two","three"]
    print(dict(zip(x, y, )))
    list_do_list()

  • @shareefshaik9848
    @shareefshaik9848 Před 3 lety

    how to convert the dictionary back to list

    • @MAK335
      @MAK335 Před 3 lety

      use to_list function

    • @niveaprakash5482
      @niveaprakash5482 Před 3 lety +4

      dict1={1: 'one', 2: 'two', 3: 'three'}
      list1=[]
      for i in dict1.items():
      list1.extend(list(i))
      print(list1)

  • @NISHASINGH-gs7wh
    @NISHASINGH-gs7wh Před měsícem +1

    My Solution:
    list1 = ["Naina", "kimi", "sheena"]
    list2 = [2356, 4578, 8956]
    dict={}
    for i in range(0, len(list1)):
    dict.update({list1[i] : list2[i] })
    print(dict)

  • @siddhigolatkar8558
    @siddhigolatkar8558 Před 8 měsíci

    Thank you