Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

level chooser

By: a guest on Jan 9th, 2013  |  syntax: Python  |  size: 0.16 KB  |  views: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def choose_level():
  2.     while True:
  3.         level = int(input("Enter your level by typing 1, 2 or 3\n"))
  4.         if level in [1, 2, 3]:
  5.             return level