Computer Science
What is the output produced when this code executes?
a = 0
for i in range(4,8):
if i % 2 == 0:
a = a + i
print (a)
- 4
- 8
- 10
- 18
Python Control Flow
43 Likes
Answer
10
Answered By
8 Likes
Related Questions
What is the output produced when this code executes?
i = 1 while (i <= 7): i*= 2 print (i)Consider the following loop:
j = 10 while j >= 5: print("X") j=j-1Which of the following for loops will generate the same output as the loop shown previously?
Which of the following code segments contain an example of a nested loop?
Fill in the blanks:
The _________ statement forms the selection construct in Python.