Python Core



Admission Enquiry Form


For Loop Practice Questions.

Here in this page we can try some of the questions which can help you to understand the different type of uses of the for loop in python. You shuld try all these questions with imagination. Don't do only copy and paste.All the best...

Test Case:

for i in range(5):
print("*")

Test Case :

for i in range(1,10):
print("*",end=" ")

Test Case:

for i in range(10):
    print(i,end=" ")
    
    output is :
    0 1 2 3 4 5 6 7 8 9 

Test Case:

for i in range(1,10):
    print(i,end="*")
    
    output is :
    1*2*3*4*5*6*7*8*9* 

Test Case:

for i in range(20,1,-2):
    print(i)
    
    output is :
    20
18
16
14
12
10
8
6
4
2