AI seems mental, though, unless Python is just some glue for calling functions or libraries that are implemented in lower-level languages, which is definitely also a thing.
Most of the work is done by parallel compute hardware on most systems, not the CPU running Python.