Numbers
Reference: https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex.
Numeric Operations
Numeric functions include the usual arithmetic operators:
Boolean equality operators also apply:
Also reference the built-in round()
function: https://docs.python.org/3/library/functions.html#round.
Formatting as Currency
Use string formatting to control how numbers will display when printed:
Feel free to use (copy-paste) this function definition into your projects:
Advanced Operations
Also reference the numeric functionality of these built-in Python modules:
Last updated