Question #3389

Write a program to create a dictionary and store student id as key and student name as value and display the student id and name. After displaying the dictionary keys and values you should clear the dictionary so that your dictionary becomes empty.

Expert's answer

db = { 12324:"John Smith", 12346:"William Bakenstuff", 12423:"Sam Zoom" }

for k in db.keys():
print(k, db[k])

db = { }
LATEST TUTORIALS
APPROVED BY CLIENTS