Numbers
Creating Numbers
42 # Integer
-7 # Negative number
3.14159 # Decimal number
0.5 # Decimal less than 1Number Operations
Arithmetic
5 + 3 # Addition: 8
10 - 4 # Subtraction: 6
3 * 4 # Multiplication: 12
15 / 3 # Division: 5
17 // 5 # Integer division: 3
17 % 5 # Modulo (remainder): 2
2 ** 3 # Exponentiation: 8Comparison
Rounding and Precision
Absolute Value and Sign
Useful Number Functions
Function
Description
Example
Working with Lists of Numbers
Type Checking
Last updated
Was this helpful?
