Back
+15 XP
Concept

Standard Library Overview (`sys`, `os`, `math`)

Python comes with "batteries included"—dozens of pre-installed, high-performance modules ready to import without using `pip`.

python
import sys, math, os

print(math.sqrt(16))  # 4.0
print(sys.platform)   # OS platform string
print(os.name)        # Operating system identifier

# 11. Standard Library Overview (`sys`, `os`, `math`) Python comes with "batteries included"—dozens of pre-installed, high-performance modules ready to import without using `pip`: ```python import sys, math, os print(math.sqrt(16)) # 4.0 print(sys.platform) # OS platform string print(os.name) # Operating system identifier ``` Before adding heavy third-party packages to your `requirements.txt`, check the standard library. Core tasks like cryptography, dates, networking, and mathematical algorithms are already solved for you.

Checkpoint

Do you need to install standard library modules like `math` or `sys` with `pip`?

Practice

Import `math` and calculate the hypotenuse of a right triangle with sides 3 and 4 using `math.hypot(3, 4)`. Print the result.

Terminal
01
Tap code blocks below to assemble
Available Blocks