← 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)])
- A.[3333, 3333, 3333]
- B.[3334, 3333, 3333]
- C.[3334, 3334, 3332]
- 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 →