Write a Python Program to Print first 10 natural numbers using while loop.
Answers
Answered by
27
Answer:
This is the required Python program for the question.
i=1
while i<=10:
print(i,end=" ")
i+=1
Explanation:
- Line 1: Initialises i = 1 as we have to display first 10 natural numbers.
- Line 2: Start of loop. Loop iterates till i<=10 is true.
- Line 3: Displays the value of i.
- Line 4: Increments the value of i.
Refer to the attachment.
•••♪
Attachments:
Answered by
22
Answer:
#Python program to print first 10 natural numbers
I=1
while(I<=10) :
print(I)
Explaination:-
- I is intialized to 1
- then while Loop runs from 1 to 10 checking if I is less than or equal to 10
- if yes, print I
- else loop terminates.
- Program ends :)
Similar questions