Dictionaries in Python

Dictionaries in Python can be created by using curly braces as below: phone_nos = {} This is an empty dictionary. We can add an item like below: phone_nos[‘sreedhar’] = 123456 phone_nos[‘sam’] = 1781767 A dictionary contains keys and values. In the above example, ‘sreedhar’ and ‘sam’ are keys and 123456 and 1781767 are values. We…

Read more...