diff options
Diffstat (limited to 'csci1913')
-rw-r--r-- | csci1913/lab1/lab1_strap012.py | 13 |
1 files changed, 6 insertions, 7 deletions
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))): |