Informatics Practices
Related Questions
Suppose
>>> d1 = { 1 : 'one' , 2: 'two' , 3: 'three' , 4: 'four'} >>> d2 = { 5 :'five', 6:'six' }Write the output of the following code:
>>> d1.items() >>> d1.keys() >>> d1.values() >>> d1.update(d2) >>> len(d1)Suppose
>>> d1 = { 1 : 'one' , 2: 'two' , 3: 'three' , 4: 'four'} >>> d2 = { 5 :'five', 6:'six' }Write the output of the following code:
>>> del d1[3] >>> print(d1) >>> d1.pop(4) >>> print(d1) >>> d1 [8] =' eight' >>> print(d1) >>> d1.clear() >>> print(d1)Write a Python program to input 'n' classes and names of class teachers to store them in a dictionary and display the same. Also accept a particular class from the user and display the name of the class teacher of that class.
Write a program to store student names and their percentage in a dictionary and delete a particular student name from the dictionary. Also display the dictionary after deletion.