Answers for "python create dictionary from key value"

1

python create dictionary from key value

>>> L1 = ['a','b','c','d']
>>> L2 = [1,2,3,4]
>>> d = dict(zip(L1,L2))
>>> d
{'a': 1, 'b': 2, 'c': 3, 'd': 4}
Posted by: Guest on October-02-2020
10

how to create a dictionary in python

thisdict = {
  "key1" : "value1"
  "key2" : "value2"
  "key3" : "value3"
  "key4" : "value4"
}
Posted by: Guest on May-17-2020

Code answers related to "python create dictionary from key value"

Python Answers by Framework

Browse Popular Code Answers by Language