diff options
author | RossTheRoss <msattr@gmail.com> | 2019-09-18 12:33:16 -0500 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-09-18 12:33:16 -0500 |
commit | f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b (patch) | |
tree | b422cc23681a02dc31d039916a10b2b11dabaf89 /csci1913 | |
parent | Merge branch 'master' of github.com:RosstheRoss/TestingFun (diff) | |
download | homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.tar homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.tar.gz homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.tar.bz2 homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.tar.lz homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.tar.xz homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.tar.zst homework-f9cf44d4c8c9806b7f8a31b15bae0ad6bcf6f70b.zip |
Fix things
Diffstat (limited to 'csci1913')
-rw-r--r-- | csci1913/lab1/lab1_strap012.py | 14 |
1 files changed, 7 insertions, 7 deletions
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. |