133k views
1 vote
What is output? Select all that apply.

C = 0
while (c 10):
C = c + 5
print (c)

User Pkleczko
by
5.5k points

1 Answer

2 votes

Answer:

The answer is:

5

10

Explanation:

In the while loop, we specify, if C is not equal to 10, C += 5 and print(c). When python reads the loop, python will check to see if C is equal to 10 and if not it will add 5 until C is more than or equal to 10. In addition, python will print(c) to the console until it hits 10. Once C is less than or equal to 10 the loop will stop. In this scenario, since we print c in the loop, the codes output will be the following:

5

10

hope this helps :D

User Shrikey
by
5.3k points