Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options1 = ["Yes", "No"]
- def options():
- print 'Welcome to my Login System'
- while True:
- option = raw_input("Would you like to view the username list? (Yes/No) : ")
- if option == options1[0]: # Case it's "Yes"
- print "User typed 'Yes'"
- break # Exit the loop
- elif option == options1[1]: # Case it's "No"
- print "User typed 'No'"
- break # Exit the loop
- else: # Case it's anything else
- print "Learn to type!"
- # No break here, ask user again
- options()
- print "\nProgram ended"
Advertisement
Add Comment
Please, Sign In to add comment