# Clean user input while True: try: x = int(raw_input("Enter a number: ")) break except ValueError: print "That was not a number, try again."