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

Quiz: Polymorphism · Question 5 of 10

Which method lets a + b work for your own Python class?

Which method lets a + b work for your own Python class?

  1. A.plus
  2. B.add
  3. C.sum
  4. D.concat
Answer & explanation

Correct answer: add

Python calls a.add(b) for a + b.

Can you get the rest right without peeking?

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

Start the quiz →