Beginner·5 min·basics · math
Numbers & Math
Numbers & Math
Python handles integers and floats natively. The math module adds the rest.
Operators worth remembering
+ - * /— the usual//— floor division (drops the remainder)%— modulo (the remainder)**— exponent
Built-ins
abs(), round(), min(), max(), sum([...]).
Try it
- Compute compound interest:
1000 * (1.07 ** 10). - Use
math.log(1024, 2)— guess the answer first.