var = 10
while var > 0:
var = var -1
if var == 5:
continue
print ('Current variable value :', var)
print("Good bye!")
امثلة عن استخدامات Break
#this exerice to practice on using the break statement
#write a program that keep asking user to enter any thing in keyboard untill user enters the word 'quit'
while True:
s = input('Enter something : ')
if s == 'quit':
break
print('Length of the string is', len(s))
print('Done')