Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dictionary function fromkeys in python

key = { "India", "Austria", "USA", "Pakistan", "Czech Republic"}
value  = "Country"
countries = dict.fromkeys(key, value) # function fromkeys
counties
#returns {'USA': 'Country',
 'Pakistan': 'Country',
 'Austria': 'Country',
 'India': 'Country',
 'Czech Republic': 'Country'}
 
PREVIOUS NEXT
Tagged: #dictionary #function #fromkeys #python
ADD COMMENT
Topic
Name
8+8 =