Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Creating empty list
- countries = []
- #Creating variable that will control number of countries we can enter
- count = 0
- hateq = "q"
- #Creating the while loop
- while True: #This ensures that only five countries can be entered
- next = raw_input("Please enter a number: ")
- #If conditional statement to verify input
- if len(next) > 0 and next.isalpha():
- countries.append(next)
- count = count + 1
- else:
- print "I'm sorry, but I can't accept that input"
- break
- print countries
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement