← 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])
- A.[True, True]
- B.[False, True]
- C.[False, False]
- 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 →