🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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))
  1. A.14
  2. B.15
  3. C.16
  4. 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 →