Question 11
Consider the following snippet of code and answer the given sub-questions:def analyze(data): result = [] for item in data: if isinstance(item, tuple): total = 0 for x in item: if x % 2 == 0: total += x result.append(total) elif isinstance(item, int) and item % 2 == 1: result.append(item * 3) else: continue return result
sample = [(2, 5, 6), 7, (1, 3), 4, (8, 2, 1)] output = analyze(sample)
What is the value of output
after executing the given code?
[8, 21, 0, 4, 10]
[8, 21, 4, 2, 10]
[8, 21, 0, 10]
[8, 7, 0, 10]