@@ -0,0 +1,980 @@
+def evaluate(s):%0A    # should we consider cases like '1 - - 1'%0A    #%0A    # it's pretty complicated and inconcise so we should make it with clearer logic%0A    s = ''.join(s.split())%0A    res, i = 0, 0%0A    stack = %5B%5D%0A    %0A    while i %3C len(s):%0A        if s%5Bi%5D.isdigit():%0A            num = ''%0A            while i %3C= len(s): # be careful about the case i == len(s)%0A                if i %3C len(s) and s%5Bi%5D.isdigit():%0A                    num += s%5Bi%5D%0A                    i += 1%0A                else:%0A                    stack.append(int(num))%0A                    if len(stack) == 2:%0A                        if sym == '*':%0A                            res = stack%5B0%5D * stack%5B1%5D%0A                        elif sym == '+':%0A                            res = stack%5B0%5D + stack%5B1%5D%0A                        else:%0A                            res = stack%5B0%5D - stack%5B1%5D%0A                        stack = %5Bres%5D%0A                    break%0A        else:%0A            sym = s%5Bi%5D%0A            i += 1%0A    return res%0A

Create newlang.py