Q1.You have a list of lists. You want to compute the sum of all even numbers greater than 3. Consider the two code snippets below, with the condition left blank. Which conditions, when filled in the blanks in both snippets, will give the correct result?
Snippet 1
```
s = 0
for row in data:
for val in row:
____:
s += val
print(s)
```
Snippet 2
```
s = 0
i = 0
while i < len(data):
j = 0
while ____:
if data[i][j] % 2 == 0 and data[i][j] > 3:
s += data[i][j]
j += 1
i += 1
print(s)
```
Save
Check
Details
Q1
26 Oct 2025
Q1.You have a list of lists. You want to compute the sum of all even numbers greater than 3. Consider the two code snippets below, with the condition left blank. Which conditions, when filled in the blanks in both snippets, will give the correct result?
Snippet 1
```
s = 0
for row in data:
for val in row:
____:
s += val
print(s)
```
Snippet 2
```
s = 0
i = 0
while i < len(data):
j = 0
while ____:
if data[i][j] % 2 == 0 and data[i][j] > 3:
s += data[i][j]
j += 1
i += 1
print(s)
```