Loops in python
For Loops
list1=["windows",7,"windows",8,"windows", 10 ,"windows",11]
for item in list1:
if str(item).isnumeric()and item>=10:
print(item)
While Loops
'''i=0
while True:
if i==31:
break
print(i)
i=i+1
'''
while True:
x=int(input("enter number: "))
if x==100:
print("congratualion you type 100")
break
print(x)
else:
print("Try again!")
Comments
Post a Comment