Print Numbers using For Loop..

•

In this post we will see how to print the numbers in python using for loop concept.

In short term for loop is a looping concept that execute the code continously until the codition given to that is becomes false

let’s understand the code with an example written below and then try your own..

first make the variable ” start ” that take input number from user as integer given below..

start = int(input("Enter the starting number: "))

now make the variable ” stop ” that take the last number from user as input given below…

stop = int(input("enter the last number: "))

now give the specific condition to for loop as given below and the for loop will start printing the numbers as per the condition given by the user to it..

for x in range(start,stop,1):
    print(x)

thanks for visiting us…

Greetings from Codershub.co.in

Leave a Reply

Your email address will not be published. Required fields are marked *