From fa7bf5f114f812d7e9fe07f5195b7b42c4988f3a Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Thu, 12 Sep 2019 07:29:37 -0500 Subject: finish lab --- csci1913/lab1/lab1_strap012.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'csci1913') diff --git a/csci1913/lab1/lab1_strap012.py b/csci1913/lab1/lab1_strap012.py index e04cf82..e7029e1 100644 --- a/csci1913/lab1/lab1_strap012.py +++ b/csci1913/lab1/lab1_strap012.py @@ -25,17 +25,16 @@ def solve(v, e): def solving(v,q): if left(q)==v: return q - elif type(left(left(q))) is not tuple: + else: if op(left(q))=='+': - return solvingAdd(v, q) + newQ = solvingAdd(v, q) elif op(left(q))=='-': - return solvingSubtract(v, q) + newQ = solvingSubtract(v, q) elif op(left(q))=='*': - return solvingMultiply(v, q) + newQ = solvingMultiply(v, q) elif op(left(q))=='/': - return solvingDivide(v, q) - else: - solving(v,left(q)) + newQ = solvingDivide(v, q) + return solving(v,newQ) def solvingAdd(v,q): if isInside(v, left(left(q))): -- cgit v1.2.3