Modules (import)
Using ready-made libraries with import: math for mathematics, random for random numbers.
Simple enough for a 5-year-old to understand
import: bring in ready-made tools
In Python many ready-made functions come inside a "module". To use them you first import them.
import mathprint(math.sqrt(144))print(math.floor(4.7))print(round(math.pi, 2))🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (2 left)
🎯 Expected output: 9.0