Break & Continue Statements In Python
i = 0
while (True):
if i+1<5:
i = i + 1
continue
print(i+1, end=" ")
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
Post a Comment