Skip to content

Instantly share code, notes, and snippets.

@cesarkawakami
Created January 16, 2013 02:48
Show Gist options
  • Save cesarkawakami/4544224 to your computer and use it in GitHub Desktop.
Save cesarkawakami/4544224 to your computer and use it in GitHub Desktop.
while True:
v = input()
if v.lower() == "none":
v = None
break
try:
v = int(v)
except ValueError:
pass
else:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment