gcd and lcm
math.gcd and math.lcm return the greatest common divisor and least common multiple of integers; both accept any number of arguments (3.9+). Use them for reducing fractions, slope normalization (max points on a line) and array-wide gcd problems.
sqrt, ceil, floor
math.isqrt gives the exact integer square root (no float error); math.sqrt returns a float. ceil/floor/trunc round floats to ints. Prefer integer-only ceil division to avoid float precision bugs (e.g. Koko Eating Bananas).
comb, perm, factorial, prod
math.comb(n, k) and math.perm(n, k) compute nCk and nPk exactly with big ints; math.factorial and math.prod cover n! and products. Use them for counting problems (unique paths, Pascal's triangle) instead of hand-rolled loops.
log, exp and float precision
math.log2, log10, log(x, base) and exp for logarithms and exponentials; int.bit_length() is the exact integer alternative to log2. Floats are IEEE-754 doubles, so compare with math.isclose and reach for fractions/decimal when exactness matters.
Modular arithmetic
Problems with huge answers ask for the result modulo 109 + 7. Python ints never overflow, but taking mod at each step keeps numbers small and fast. Built-in pow(b, e, mod) does fast modular exponentiation and modular inverse.