Subtraction
suggest changea, b = 1, 2
# Using the "-" operator:
b - a # = 1
import operator # contains 2 argument arithmetic functions
operator.sub(b, a) # = 1
Possible combinations (builtin types):
int
andint
(gives anint
)int
andfloat
(gives afloat
)int
andcomplex
(gives acomplex
)float
andfloat
(gives afloat
)float
andcomplex
(gives acomplex
)complex
andcomplex
(gives acomplex
)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents