math and random
The math module holds the usual functions for numbers, and random makes pseudo-random choices.
import math
print(math.sqrt(16), math.pi)
print(math.floor(2.7), math.ceil(2.1))
print(math.hypot(3, 4)) # 5.0
print(math.dist((0, 0), (1, 1)))
print(math.prod([2, 3, 4])) # 24math.floor rounds down and math.ceil rounds up, and both return an int. math.dist measures a straight line between two points.
Seeded randomness
import random
rng = random.Random(7)
print(rng.randint(1, 6)) # 1 to 6
print(rng.choice(["a", "b"]))
print(rng.random()) # below 1A seed fixes the sequence: random.Random(7) makes the same choices on every run, which tests need. randint(a, b) includes both ends, unlike range. Make your own Random object instead of calling random.seed, which resets the generator that every other part of the program shares.
Your task
Write roll_dice(n, seed) returning a list of n six-sided die rolls made with its own random.Random(seed), without touching the shared generator. Write distance(a, b) returning the straight-line distance between two (x, y) points.
The explanation opens here once every check passes.