Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 10, 2020 07:41
Show Gist options
  • Save uncoded-ro/a8b46f2f8bf636611d7146b9a2280903 to your computer and use it in GitHub Desktop.
Save uncoded-ro/a8b46f2f8bf636611d7146b9a2280903 to your computer and use it in GitHub Desktop.
try:
numar = int(input("Introdu un intreg pozitiv: "))
if numar <= 0:
raise ValueError("Acesta nu este un numar pozitiv!")
except ValueError as e:
print(e)
else:
print("Multumim!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment