Skip to content
Permalink
Browse files
Update chatmaths.py
  • Loading branch information
carreira committed Nov 29, 2018
1 parent 6ae349c commit 1e7266c48c80aef67f90232f206f2d84d35ccc0d
Showing 1 changed file with 3 additions and 5 deletions.
@@ -111,14 +111,12 @@ def sums(acum, index):

""" replaces the indexes after the operations are done. After that if calls again the function in order to keep the operations """
def working(tot, acum,index,type):
if "sum" in type:
acum[index - 1] = tot # replaces the indexes before with the result of the operation
acum.remove(acum[index + 1]) # removes the other indexeses involved in the operation
acum.remove(acum[index]) # "" ""
if "sum" in type:
sums(acum, index) # calls the function again, with the same indexes since we removed two indexeses from the list
else:
acum[index - 1] = tot # replaces the indexes before with the result of the operation
acum.remove(acum[index + 1]) # removes the other indexeses involved in the operation
acum.remove(acum[index]) # "" ""
mults(acum, index) # calls the function again, with the same indexes since we removed two indexeses from the list
mults(acum, index) # calls the function again, with the same indexes since we removed two indexes from the list


0 comments on commit 1e7266c

Please sign in to comment.