Thursday, March 31, 2022

Python Loop

 Loop : The execution of a specific code may need to repeated several number of times.

1. For Loop

2. While Loop

 

 Program 1

N  = Int (Input (" Enter any no ")

For i in range (1,11 ):
        c = n*i
        print ( N , "*", i , " = ", C)

Program 2. 

i = 1
While ( i < = 10 ):
        Print ( i )
        i = i +1

 










No comments:

Post a Comment