Q21.Consider the following snippet of code. What will the output be?
```
val = 0
L = [7, 1, 8, 3, 10]
temp = []
for num in L:
if num % 2 == 0:
temp.append(num)
else:
val += num
print(len(temp) * val)
```
Save
Check
Details
Q21
7 Jul 2024
Q21.Consider the following snippet of code. What will the output be?
```
val = 0
L = [7, 1, 8, 3, 10]
temp = []
for num in L:
if num % 2 == 0:
temp.append(num)
else:
val += num
print(len(temp) * val)
```