Computer Science, asked by TeeshaAhuja, 9 months ago

python program to print natural number by using for loop ​

Answers

Answered by AlissaW
1

Answer:

Python Program to Print Natural Numbers using For Loop. This Python program for natural numbers allows user to enter any integer value. Next, this program will print natural numbers from 1 to user specified value using For Loop.

Answered by sushiladevi4418
4

Answer:

Python code to print natural numbers by using for loop.

Explanation:

## WAP to print natural no. using for loop.

## input any number

num = int(input("Enter any number : "))

print("\nNatural numbers from 1 to", num)

for i in range(1, num + 1):

   print(i, end=" ")

## it print the natural numbers

Output:-

Enter any natural number: 10

1 2 3 4 5 6 7 8 9 10

Similar questions