0
Control Flow<<Time’s Up
Sorry, but I can't reach the result. Task:# take the number as input number = int(input()) #use a while loop for the countdown My version: while number>0: print(number) number=number-1 Where is the error?
3 ответов
+ 1
# Hi Natia Koberidze,
# If you want to reach zero in your countdown here are some tips:
# Decrease the value of 'number' by 1, which is elegantly done in Python with:
# number -= 1
number = 5
while number >= 0:
print(number)
number -= 1
# Another way is to use a for loop like this:
n = 5
for i in range(n, -1, -1):
print(i)
0
I can't see any errors. What should happen?
0
Thanks to all of you so much! The correct answer is:
number >=0:
As far as I am studying PY from this app, there was no mention of >= before this task.
Thus, tour help is priceless! 🧡