Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to create a python dictionary without defining values

# Python code to initialize a dictionary
# with only keys from a list
  
# List of keys
keyList = ["Paras", "Jain", "Cyware"]
  
# initialize dictionary
d = {}
  
# iterating through the elements of list
for i in keyList:
    d[i] = None
      
print(d)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #How #create #python #dictionary #defining #values
ADD COMMENT
Topic
Name
8+8 =