Friday 1 January 2021

Python program to print 10 to 1 using while

 Following Python program will print 10 to 1 numbers using while loop. 

Expected Output: 10 9 8 7 6 5 4 3 2 1


Program Code:

number = 10

while number >= 1:
  print(number, end=" ")
  number = number - 1


Output of Program:

10 9 8 7 6 5 4 3 2 1


* * * * *


< Back to Python Loops >

< Back to Home >

No comments:

Post a Comment