Computer Science
What is the output produced when this code executes?
i = 1
while (i <= 7):
i*= 2
print (i)
- 8
- 16
- 4
- 14
- no output
Python Control Flow
19 Likes
Answer
8
Answered By
4 Likes
Related Questions
What is the output when this code executes ?
x = 1 while (x <= 5): x + 1 print(x)How many times does the following code execute ?
x = 1 while (x <= 5): x + 1 print (x)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?
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)