class Solution(object):
    def evalRPN(self, tokens):
        """
        :type tokens: List[str]
        :rtype: int
        """
        n,stack=len(tokens),[]
        if n==0:
            return
        for i in range(n):
            if len(tokens[i])>1 or "0"<=tokens[i][0]<="9":
                stack.append(int(tokens[i]))
            elif tokens[i]=="+":
                temp=stack[-1]+stack[-2]
                stack.pop()
                stack.pop()
                stack.append(temp)
            elif tokens[i]=="-":
                temp=stack[-2]-stack[-1]
                stack.pop()
                stack.pop()
                stack.append(temp)
            elif tokens[i]=="*":
                temp=stack[-2]*stack[-1]
                stack.pop()
                stack.pop()
                stack.append(temp)
            elif tokens[i]=="/":
                temp=int(stack[-2]/stack[-1])
                stack.pop()
                stack.pop()
                stack.append(temp)
        return stack[0]
s=Solution()
s.evalRPN(["10","6","9","3","+","-11","*","/","*","17","+","5","+"])
#
在python2中"0"<=tokens[i][0]<="9"不能这么用
