Break & Continue Statements In Python

 i = 0

while (True):
    if i+1<5:
        i = i + 1
        continue
    print(i+1end=" ")
    if(i==50):
        break 
    i = i + 1





Exercise::
while(True):
    inp = int(input("enter your number"))
    if inp>100:
        print("congrats you have entered a number greater than 100")
        break
    else:
        print("try again!")
        continue








Comments

Popular posts from this blog

Calculator

Python File IO Basics