Last active
April 24, 2020 01:54
-
-
Save mikelopez/7a115f1a42a041b91099afe7585cbac4 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
import sys | |
def ask_number(msg="Enter a number"): | |
num = float(input(msg)) | |
if not type(num) in [float, int]: | |
print("Not a number!") | |
ask_number(msg) | |
else: | |
return num | |
num = ask_number() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment