how exit while loop after continue python code example
Example 1: python while continue
while True:
print('Who are you?')
name = input()
if name != 'Joe':
continue
print('Hello, Joe. What is the password? (It is a fish.)')
password = input()
if password == 'swordfish':
break
print('Access granted.')
Example 2: python break continue
words = ["rain", "sun", "moon", "exit", "weather"]
for word in words:
if word == "exit" :
break;
if word == "moon" :
print("moon is skipped")
continue
print ("This won't be printed")
print (word)