Skip to content

Instantly share code, notes, and snippets.

Created Apr 23, 2017
What would you like to do?
def ask_int(question):
"""Ask a question and return an integer."""
while True:
return int(input(question))
except ValueError:
print("Not a number, please try again.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment