Python Program Using a While Loop That Asks the User for a Number, and Prints a Countdown From That Number to Zero

Aim:

Write a program using a while loop that asks the user for a number, and prints a
countdown from that number to zero.

Program:

n = int(input("Enter A Number--->"));
while n >=0:
print (n);
n = n - 1;

Output:

Enter A Number--->10
10
9
8
7
6
5
4
3
2
1
0 

Leave a Comment