🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Banker's Algorithm in Practice: all 15 questions

Quiz: Banker's Algorithm in Practice · Question 9 of 15

What does this print? (code)

What does this print?

need = [[1, 0, 1], [2, 2, 0]]
work = [1, 1, 1]
print([all(n <= w for n, w in zip(row, work)) for row in need])
  1. A.[True, True]
  2. B.[False, True]
  3. C.[False, False]
  4. D.[True, False]
Answer & explanation

Correct answer: [True, False]

(1,0,1) fits inside (1,1,1); (2,2,0) needs 2 of A and 2 of B, which are not available.

Can you get the rest right without peeking?

Take the timed Quiz: Banker's Algorithm in Practice quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →