Question OOP-EXC-0044
MediumWhat is the output of this code?
r = []
for v in ["4", "a", "0"]:
try:
r.append(8 // int(v))
except ValueError:
r.append("V")
except ZeroDivisionError:
r.append("Z")
print(r)
- A.
[2, 'Z', 'V']
- B.
[2, 'V', 'Z']
- C.
Sign up free to see the answer and a step-by-step explanation.