While Loop with Python

While loop is pretty awesome in Python. Lets see an example:
def print_numbers(j): #define a function print_numbers
    i = 0
    
    while (i!=j):        
        
        i = i+1       #increment 
        print i
                  
   
print_numbers(6) #call the function 
Output:
1
2
3
4
5
6

Comments

Popular posts from this blog

পিৎজা এবং বই

How to Download Video from Youtube - The Easiest way