From 0d0bbd4a4d5a1fcd3e1db7274ba08586689b62a9 Mon Sep 17 00:00:00 2001 From: Dolphin-Bunny <49925062+Dolphin-Bunny@users.noreply.github.com> Date: Tue, 9 Jun 2020 12:04:34 -0400 Subject: [PATCH] add support for non-numerical inputs all changes are between lines 20821 and 20827 --- my_first_calculator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/my_first_calculator.py b/my_first_calculator.py index bf7c560..6b4322f 100644 --- a/my_first_calculator.py +++ b/my_first_calculator.py @@ -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 :)")