Created
August 19, 2022 12:14
-
-
Save saraswatmks/4a5730043a8a3dae6ad9b3d5a97da3f2 to your computer and use it in GitHub Desktop.
Validate input response
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
def validate_input(gross): | |
try: | |
return int(gross) | |
except ValueError as e: | |
print("Incorrect gross input. Please provide gross value as int or float.") | |
gross = input('provide gross input') | |
gross = validate_input(gross) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment