Advertisement
Guest User

py_now

a guest
Nov 23rd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #Creating empty list
  2. countries = []
  3.  
  4. #Creating variable that will control number of countries we can enter
  5. count = 0
  6. hateq = "q"
  7.  
  8. #Creating the while loop
  9. while True: #This ensures that only five countries can be entered
  10. next = raw_input("Please enter a number: ")
  11. #If conditional statement to verify input
  12. if len(next) > 0 and next.isalpha():
  13. countries.append(next)
  14. count = count + 1
  15. else:
  16. print "I'm sorry, but I can't accept that input"
  17. break
  18. print countries
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement