Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- names = "" #Declares variable as string
- a = [] #Declares variable as list
- while names not in("Exit", "exit", "EXIT", "eXIT"): #Loop will repeat until user types exit.
- names = input("Enter Name (or type exit to finish): ") #Prompts user to type name.
- try:
- a.append(names) #Adds the input to a list
- except (names.isalpha() == False) and (names.isspace() == False):
- print("Please type a name that doesn't have numbers or symbols.")
- continue
- except len(names) > 45:
- print("Please type a name that is less than 46 characters")
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement