Program code:
Clear Doubts with Computer TutorIn case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in
Output:
{'a': 1, 'b': 2, 'c': 4, 'd': 5, 'e': 6}
A dictionary is a collection that is unordered, changeable, and indexed. In Python, dictionaries are written with curly brackets, and they have keys and values.
You can access the items of a dictionary by referring to its key name, inside square brackets.
Dictionaries are optimized to retrieve values when the key is known.
Basic python functionality is demonstrated in above program.
To view all the lessons in chapter 1: http://computertutor.in/class-12-computer-science/chapter-2/
To view entire class 12 computer science study material: http://computertutor.in/resources/
You cannot copy content of this page