All pastes #215489 Raw Edit

Miscellany

public text v1 · immutable
#215489 ·published 2006-10-22 17:16 UTC
rendered paste body
    def proccessCommand(cmd):
        returnthis=[]
        tmpstr=""+cmd
        loc=0
        for char in cmd:
             if char in "+−*/":
                returnthis.append(tmpstr[:loc-1])
                returnthis.append(tmpstr[loc-1:loc]
                tmpstr=tmpstr[:loc]
                loc=0
             else:
                loc++
        return returnthis

i get this error:
  File "calc3.py", line 97
    tmpstr=tmpstr[:loc]
         ^
SyntaxError: invalid syntax

when i comment out that line i get this error:
  File "calc3.py", line 98
    loc=0
      ^
SyntaxError: invalid syntax