From eede23e4e70830c10a20fbea6ef9e27a91771ac4 Mon Sep 17 00:00:00 2001 From: Joel Peyton <45272571+joelpeyton@users.noreply.github.com> Date: Tue, 4 Dec 2018 20:53:37 +0000 Subject: [PATCH] Fix ValueError issue On typing exit, the original file had: ValueError: invalid literal for int() with base 10: 'exit' --- debugging/pdb_ex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debugging/pdb_ex.py b/debugging/pdb_ex.py index 49385b0..e20574e 100644 --- a/debugging/pdb_ex.py +++ b/debugging/pdb_ex.py @@ -8,7 +8,7 @@ print("To exit this game type 'exit'") num1 = choice(random2) num2 = choice(random1) - answer = int(input("What is {} times {}? ".format(num1, num2))) + answer = input("What is {} times {}? ".format(num1, num2)) # exit if answer == "exit": @@ -16,7 +16,7 @@ sys.exit() # determine if number is correct - elif answer == num1 * num2: + elif int(answer) == num1 * num2: print("Correct!") break else: