Question DSA-BIT-0016
HardWhat is the output of this code?
a = [1, 2, 3]
print([[a[i] for i in range(3) if mask >> i & 1] for mask in range(8)])
- A.
[[1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
- B.
[[1, 2, 3]]
- C.
Sign up free to see the answer and a step-by-step explanation.