Computer Science, asked by sunshinemuskan3, 5 months ago

D. None of the above
20. What will be the output of the following Python
code?
list1 = [3 , 2,5,6,0,7,9)
sum = 0
sum1 = 0
for elem in list1:
if (elem % 2 == 0);
sum = sum + elem
continue
if (elem % 3 == 0):
sum1 = sum1 + elem
print(sum, end="")
print(sum1)
(1 Point)​

Answers

Answered by 9akumawatramlal
0

Answer:

please follow me

and Mark me as brainleast

Answered by qwnerazzuri
0

Output:

8

12

Here, the "for" loop is used to take each number from the list one at a time. there are 2 if statements inside the loop one is for checking the number is divisible by 2 and another number is divisible by 3.

Now,

the sum of the number divisible by 2 will be one output and

the sum of the number divisible by 3 will be the other output.

Similar questions