減法

a, b = 1, 2

# Using the "-" operator:
b - a                  # = 1

import operator        # contains 2 argument arithmetic functions
operator.sub(b, a)     # = 1

可能的組合(內建型別):

  • int 和 int(給一個 int)
  • int 和 float(給一個 float)
  • int 和 complex(給一個 complex)
  • float 和 float(給一個 float)
  • float 和 complex(給一個 complex)
  • complex 和 complex(給一個 complex)