Python Numbers
Work with numbers and perform calculations in Python.
Do math with Python.
Number Types
```python age = 25 # Integer price = 19.99 # Float temperature = -5 # Negative integer ```
Basic Math
```python x = 10 y = 3
print(x + y) # 13 (addition) print(x - y) # 7 (subtraction) print(x * y) # 30 (multiplication) print(x / y) # 3.333... (division) print(x // y) # 3 (floor division) print(x % y) # 1 (remainder) print(x ** y) # 1000 (power) ```
Useful Functions
```python print(round(3.7)) # 4 print(abs(-10)) # 10 print(max(5, 10, 3)) # 10 print(min(5, 10, 3)) # 3 ```
Math Module
```python import math
print(math.sqrt(16)) # 4.0 print(math.pi) # 3.14159... print(math.floor(3.7)) # 3 ```
Remember
- Use // for integer division - Import math for advanced functions - Python handles big numbers automatically