← Quiz: Proof Techniques: all 9 questions
Quiz: Proof Techniques · Question 8 of 9
What does this print? (code)
What does this print?
objects, boxes = 100, 7
print(-(-objects // boxes))
- A.14
- B.15
- C.16
- D.7
Answer & explanation
Correct answer: 15
-(-a // b) computes ⌈a/b⌉ = ⌈100/7⌉ = 15: some box must hold at least 15 objects.
Can you get the rest right without peeking?
Take the timed Quiz: Proof Techniques quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →