add support for non-numerical inputs

all changes are between lines 20821 and 20827
This commit is contained in:
Dolphin-Bunny 2020-06-09 12:04:34 -04:00 committed by GitHub
parent a7aabeaf49
commit 0d0bbd4a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20819,4 +20819,10 @@ if num1 == 50 and sign == '*' and num2 == 49:
if num1 == 50 and sign == '*' and num2 == 50:
print("50*50 = 2500")
try:
num1 = int(num1)
num2 = int(num2)
except e:
print(num1, sign, num2, "=", num1, sign, num2)
print("Thanks for using this calculator, goodbye :)")