top of page

Loops in Python

Updated: Apr 19, 2023



There are two types of loops namely for and while.



a = [1,2,3,4]

for x in a:
    print(x)
    
i = 0
while i < len(a):
    i = i + 1
    if i == 2:
        break
    elif i == 3:
        continue
    
    print(a[i])

The link to the Github repository is here .


Subscribe to get all the updates

© 2025 Metric Coders. All Rights Reserved

bottom of page