Last active
July 13, 2017 12:28
-
-
Save enricopolanski/7e876bfa5b7200a5fe85a5850546f86b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
try: | |
height = int(input("Enter a number between 0 and 23: ")) | |
except (ValueError): | |
print("Not an integer!") | |
continue | |
else: | |
if not 0 <= height <= 23: | |
print("Height's smaller than 0 or bigger than 23") | |
continue | |
else: | |
break | |
print("You selected an height of " + str(height)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment