From f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Wed, 18 Sep 2019 12:33:16 -0500 Subject: Fix things --- csci1913/lab1/lab1_strap012.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'csci1913') diff --git a/csci1913/lab1/lab1_strap012.py b/csci1913/lab1/lab1_strap012.py index 582c3be..92975f7 100644 --- a/csci1913/lab1/lab1_strap012.py +++ b/csci1913/lab1/lab1_strap012.py @@ -50,14 +50,14 @@ def solvingDivide(v,q): dispatcher={'+':solvingAdd,'-':solvingSubtract,'*':solvingMultiply,'/':solvingDivide} def solving(v,q): -if left(q) is v: - return q - else: - if op(left(q)) in dispatcher: + if left(q) is v: + return q + else: + if op(left(q)) in dispatcher: newQ=dispatcher[op(left(q))](v,q) - else: - raise ValueError - return solving(v,newQ) + else: + raise ValueError + return solving(v,newQ) # # TESTS. Test the equation solver for CSci 1913 Lab 1. -- cgit v1.2.3