5.4 KiB
5.4 KiB
In [ ]:
x = 0
while x < 10:
print('x is currently: ',x)
print(' x is still less than 10, adding 1 to x')
x+=1In [ ]:
x = 0
while x < 10:
print('x is currently: ',x)
print(' x is still less than 10, adding 1 to x')
x+=1
else:
print('All Done!')In [ ]:
x = 0
while x < 10:
print('x is currently: ',x)
print(' x is still less than 10, adding 1 to x')
x+=1
if x==3:
print('x==3')
else:
print('continuing...')
continueIn [ ]:
x = 0
while x < 10:
print('x is currently: ',x)
print(' x is still less than 10, adding 1 to x')
x+=1
if x==3:
print('Breaking because x==3')
break
else:
print('continuing...')
continueIn [ ]:
# DO NOT RUN THIS CODE!!!!
while True:
print("I'm stuck in an infinite loop!")