A module is a file of Python code you can use. Python ships with hundreds of them, called the standard library. There are three common ways to import:
import math, then math.sqrt(16);
from math import sqrt, then sqrt(16);
import datetime as dt, then dt.date(2026, 3, 1).
math has sqrt, floor, ceil, prod and fsum. random picks values: choice, sample, shuffle, randint. Random results change on every run unless you call random.seed(...) first, which makes a draw repeatable, for an audit sample for example.
A name can only mean one thing at a time. random = [...] replaces the module with your list, and random.choice stops working. Pick another variable name.
When a file runs as a script (and in a notebook), __name__ is "__main__". Code under if __name__ == "__main__": runs then, but not when another file imports this one.