Question 5
What will be the output of the following code snippet?
data = [(4, 7), (5, 8), (6, 6), (9, 3)]
total = 0
for a, b in data:
if a % 2 == 0:
if a < b:
total += (b - a)
elif a == b:
total += a + b
else:
total += (a * b) % 4
else:
if b % 2 == 0:
total += b
else:
total -= a
print(total)
30
14
16
6