Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
try:
num = "text"
num2 = 2
ans = num2/num
except TypeError:
print("An Error occured: You cannot perfom division on a string.")
else:
print("The answer is: " + str(ans))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment