Professional Documents
Culture Documents
Python Dictionary Unit2
Python Dictionary Unit2
Creating Dictionary:
• It is a collection of an unordered set of key:value pairs which are enclosed
in curly braces. The key value pairs are seperated by commas.
Eg: Alice: 2341
• The words to the left of colon are called as keys and the words to the right
of the colon are called as values.
Update([key]:[value]) :
This function updates the key value pairs and is automatically added to the
dictionary.
Nested dictionaries:
Syntax: dictionary_name[“dict_marks”]
The dictionairies can be defined inside other dictionary.