CBSE · 083Class XII · 2023Section A1 mark

Question 09

30 March 2023 · Computer Science (083)

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

python
print(Stud.pop()) # Statement 4
print(Stud) # Statement 5

Answer

(d) Statements 2 and 4

Explanation

Statement 2 fails because 95 is a value, not a key. Statement 4 fails because dict.pop() requires a key argument.