Skip to content

Instantly share code, notes, and snippets.

@vihar
Last active July 27, 2017 21:04
Show Gist options
  • Save vihar/78a751cf56aa7e58f0076c30c716876b to your computer and use it in GitHub Desktop.
Save vihar/78a751cf56aa7e58f0076c30c716876b to your computer and use it in GitHub Desktop.
try:
a = int(input("Enter a negative integer: "))
if a >= 0:
raise ValueError("That is not a negative number!")
except ValueError as ve:
print(ve)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment