Advertisements
Advertisements
Question
Which of the following statement(s) would give an error after executing the following code?
Stud = {"Murugan": 100, "Mithu": 95} # Statement 1
print (Stud [95]) # Statement 2
Stud ["Murugan"]=99 # Statement 3
print (Stud.pop()) # Statement 4
print (Stud) # Statement 5
Options
Statement 2
Statement 3
Statement 4
Statements 2 and 4
MCQ
Solution
Statements 2 and 4
Explanation:
- Statement 2: 95 does not appear on the dictionary's key.
- Statement 4: The item's key is required by the pop() method.
shaalaa.com
Is there an error in this question or solution?