Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit ebbba8d9 authored by Rachel D Frenkel's avatar Rachel D Frenkel
Browse files

copy

parent 9567296c
......@@ -10,7 +10,6 @@ operators = {
'*': operator.mul,
'/': operator.truediv,
'^': operator.pow,
'!': math.factorial,
}
......@@ -21,16 +20,16 @@ def calculate(myarg):
token = int(token)
stack.append(token)
except ValueError:
if token == 'copy':
cpy = stack.pop()
stack.append()
stack.append()
continue
function = operators[token]
if numOps > 0:
result = function(stack.pop())
stack.append(result)
else:
arg2 = stack.pop()
arg1 = stack.pop()
result = function(arg1, arg2)
stack.append(result)
numOps += 1
arg2 = stack.pop()
arg1 = stack.pop()
result = function(arg1, arg2)
stack.append(result)
print(stack)
if len(stack) != 1:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment