Numeric Operations

All numeric types (except complex) support the following operations, sorted by ascending priority.

a = 3
b = 2

print(a + b)     # 5
print(a - b)     # 1
print(a * b)     # 6
print(a / b)     # 1.5
print(a // b)    # 1
print(a % b)     # 1
print(-a)        # -3
print(a ** b)    # 9

results matching ""

    No results matching ""