input: Write a python function to evaluate postfix expressions using a stack.
  assert calculator('23+') == 5
  assert calculator('56*') == 30
  assert calculator('23+4*') == 20
  assert calculator('345+*') == 27
output: def calculator(expression):
      stack = []
      for char in expression:
          if char.isdigit():
              stack.append(int(char))
          else:
              b = stack.pop()
              a = stack.pop()
              if char == '+':
                  stack.append(a + b)
              elif char == '-':
                  stack.append(a - b)
              elif char == '*':
                  stack.append(a * b)
              elif char == '/':
                  stack.append(a / b)
      return stack[0]