Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. names = "" #Declares variable as string
  2. a = [] #Declares variable as list
  3. while names not in("Exit", "exit", "EXIT", "eXIT"): #Loop will repeat until user types exit.
  4. names = input("Enter Name (or type exit to finish): ") #Prompts user to type name.
  5. try:
  6. a.append(names) #Adds the input to a list
  7. except (names.isalpha() == False) and (names.isspace() == False):
  8. print("Please type a name that doesn't have numbers or symbols.")
  9. continue
  10. except len(names) > 45:
  11. print("Please type a name that is less than 46 characters")
  12. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement