🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Refactoring with AI: all 10 questions

Quiz: Refactoring with AI · Question 8 of 10

What does this print? (code)

What does this print?

old = {(9.0, 0): 30000, (8.5, 0): 45000, (6.0, 0): 60000}
new = {(9.0, 0): 45000, (8.5, 0): 45000, (6.0, 0): 60000}
print(sum(old[k] != new[k] for k in old))
  1. A.1
  2. B.0
  3. C.2
  4. D.3
Answer & explanation

Correct answer: 1

Only the 9.0 case differs.

Can you get the rest right without peeking?

Take the timed Quiz: Refactoring with AI quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →