Computer Science, asked by Kscn903, 2 months ago

Write a Python Program to Print first 10 natural numbers using while loop.

Answers

Answered by anindyaadhikari13
27

Answer:

This is the required Python program for the question.

i=1

while i<=10:

   print(i,end=" ")

   i+=1

Explanation:

  1. Line 1: Initialises i = 1 as we have to display first 10 natural numbers.
  2. Line 2: Start of loop. Loop iterates till i<=10 is true.
  3. Line 3: Displays the value of i.
  4. Line 4: Increments the value of i.

Refer to the attachment.

•••♪

Attachments:
Answered by BrainlyProgrammer
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