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

Quiz: Python Interview Programs · Question 3 of 13

What does this print? (code)

What does this print?

print(sum(int(d) ** 3 for d in "153"))
  1. A.9
  2. B.153
  3. C.27
  4. D.135
Answer & explanation

Correct answer: 153

1 + 125 + 27 = 153 — that's why 153 is an Armstrong number.

Can you get the rest right without peeking?

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

Start the quiz →