1# python 3
2
3for x in range(1, 10):
4 print(x)
5 if x == 4:
6 break
7# prints 1 to 4
8
1alphabet = ['a' , 'b' , 'c' , 'd' ]
2for letter in alphabet:
3 if letter == 'b' :
4 continue
5 #continues to next iteration
6 print( letter )
7for letter in alphabet:
8 if letter == 'b' :
9 break
10 #terminates current loop
11 print( letter )
12for letter in alphabet:
13 if letter == 'b' :
14 pass
15 #does nothing
16 print( letter )
1#the loop
2for x in (1, 10, 1):
3 #type break to end loop before loop stops
4 break