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

Quiz: Testing AI Code · Question 6 of 10

What does this print? (code)

What does this print?

share, extra = divmod(10000, 3)
print([share + 1 if i < extra else share for i in range(3)])
  1. A.[3333, 3333, 3333]
  2. B.[3334, 3333, 3333]
  3. C.[3334, 3334, 3332]
  4. D.[3333, 3333, 3334]
Answer & explanation

Correct answer: [3334, 3333, 3333]

The leftover paisa goes to the first person, so the shares add up to 10000.

Can you get the rest right without peeking?

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

Start the quiz →