Py Modules — Free Python Tutorial
Learn Py Modules in Python with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Py Modules in Python with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Py Modules in Python
A module is a Python file (.py) containing functions, classes, and variables that you can reuse across multiple programs. Instead of rewriting common logic, you import it.
Python has a rich standard library of built-in modules (no installation needed): math (mathematical functions), random (random numbers), datetime (date and time), os (operating system), json (JSON parsing), csv (CSV files), sys (system), re (regular expressions).
Third-party packages (need pip install): numpy (arrays, maths), pandas (data), matplotlib (charts), requests (HTTP calls), Flask (web framework), sklearn (machine learning). Install with: pip install package-name.
Py Modules — Syntax
import math # import full module from math import sqrt # import specific function import math as m # import with alias # Standard library modules: import random, datetime, json, os, sys, re, csv
Learn Py Modules step by step with Syllab's free interactive Python tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Python course →