Friday 1 January 2021

Python program to print 1 to 10 using while loop

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

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


Program Code:

number = 1

while number <= 10:
  print(number, end=" ")
  number = number + 1


Output of Program:

1 2 3 4 5 6 7 8 9 10


* * * * *


< Back to Python Loops >

< Back to Home >



No comments:

Post a Comment