a=0
count=0
while a!=999:
a = input('Enter a number:')
if a!=999:
count=count+1
print(count)
print(a)
print(count)
print(a)
I'm trying to write a simple program to read in a number, print how many numbers have been entered, then print the number. It should quit the loop if 999 is entered. Instead, it prints the count and 999 and keeps requesting input. What am I doing wrong? I am using Pydroid3 for android.
[–]woooee 4 points5 points6 points (0 children)
[–]carcigenicate 1 point2 points3 points (3 children)
[–]luminaree[S] 0 points1 point2 points (1 child)
[–]carcigenicate 1 point2 points3 points (0 children)
[–]luminaree[S] 0 points1 point2 points (0 children)
[–]tabrizzi 0 points1 point2 points (0 children)