+ 1
I performed a program using 'while', the program keeps running to infinity.
c = 50 while c < 90: print(c)
3 Answers
0
here is an exemple:
c = 50
while c < 90:
print(c)
c += 1
however, when counting like so, it would be better to go with a for loop. In python you would write it like so:
for c in range(50, 90):
print(c)
I hope this helps :)
+ 1
You need to increment c by one in the while loop. In your example c constantly has the value 50 , which is the reason why the while loop doesn't stop.
0
thanks, can you show me an example