Tags
Asked 2 years ago
5 Aug 2021
Views 240
Joesph

Joesph posted

Is dict a keyword in Python ?

Is dict a keyword in Python ?
Mitul Dabhi

Mitul Dabhi
answered Aug 8 '21 00:00

dict is used to create dictionary


c=dict()

it will create empty dictionary c=dict() is equal to c={}


c=dict([('foo', 100), ('bar', 200)])
print(c)

again it will create dictionary with two value and indexing
it same like c={'foo':100, 'bar': 200}

Post Answer