Skip to content

Instantly share code, notes, and snippets.

@altendky
Forked from enricopolanski/requestingheight.py
Last active July 13, 2017 12:26
Show Gist options
  • Save altendky/6c1dc853d3d99bcda48e3dec4ac45c0d to your computer and use it in GitHub Desktop.
Save altendky/6c1dc853d3d99bcda48e3dec4ac45c0d to your computer and use it in GitHub Desktop.
height = None
while height is None:
try:
height = int(input("Enter something: "))
except (ValueError):
print("Not an integer!")
else:
if not 0 < height < 23:
print("Height's smaller than 0 or bigger than 23")
height = None
print("You selected an height of " + height)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment