 
                 
                InterviewSolution
| 1. | Write a Python statement to declare a Dictionary named ClassRoll with Keys as 1, 2, 3 and corresponding values as ‘Reena’, ‘Rakesh’, ‘Zareen’ respectively. | 
| Answer» ould be two ways.Way 1:Way 2:In the first METHOD, we directly assign the values to the variable, using curly brackets, making it a dictionary.In the second method, we first decide the data type of the variable ClassRoll and then assign values in to it. A dictionary is a data type in Python that enables a KEY-value relationship. All dictionaries are enclosed in curly brackets. The FORMAT of a dictionary is as FOLLOWS:Dictionary_name = {Key1:Value1, Key2:Value2, Key3:Value3, ... }In a dictionary, the elements can be accessed using their keys, that act as indexes. Dictionary_name[Key1] would return the value corresponding to Key1, i.e., Value1. The same goes for all the other keys. If an unknown key has been CALLED, it would render an error. | |