Free · 22 topics · no sign-up
Python notes for students
Topic-wise Python notes with code examples, common mistakes and practice questions with answers. Read them on any phone, free, with no sign-up.
These notes follow the free BrainBit Infotech Teaching Python course, from your first print() to Flask web apps. Each topic explains the idea in plain English, shows short programs you can run, lists the mistakes beginners make and ends with practice questions. Read them in order if you are new to Python, or jump to the topic your class is on. For revision before a test, use the printable cheat sheet.
Part 1: Python Foundations
- Python introduction: your first programWhat Python is, installing it, print() with sep and end, comments, and the three errors every beginner meets.
- Python variables, data types and input()Variables, naming rules, the four basic data types, input() and converting between types.
- Python operators and expressionsArithmetic, floor division and remainder, precedence, assignment, comparison and logical operators, and built-in maths functions.
- Python strings and f-stringsIndexing, slicing, string methods, split() and join(), f-strings and formatting, escape characters and in.
- Python if, elif, else and match-caseif, else and the elif ladder, nested if, good conditions, the one-line conditional expression and match-case.
- Python loops: for, while and range()for loops and range(), while loops, break and continue, the menu pattern, nested loops and patterns.
Part 2: Data Structures & Functions
- Python listsCreating and changing lists, adding and removing items, sorting and searching, looping, 2D lists and copying.
- Python tuples and setsTuples, packing and unpacking, when to use a tuple, sets for unique items and set operations.
- Python dictionariesKeys and values, get(), adding, updating and deleting, looping with items(), counting, and nested data.
- Python functionsdef and return, parameters and arguments, defaults, *args and **kwargs, scope, lambda, docstrings and recursion.
- Python modules, packages and pipImporting modules, math, random and datetime, writing your own module, and installing packages with pip.
Part 3: Files, Errors & OOP
- Python file handling: text, CSV and JSONopen() and file modes, with blocks, reading and writing text, appending, paths, CSV and JSON files.
- Python errors and exception handlingCommon exceptions, try and except, else and finally, raise, custom exceptions, input validation and tracebacks.
- Python classes and objects (OOP part 1)Classes and objects, __init__ and self, methods, __str__ and __repr__, class vs instance attributes, lists of objects.
- Python inheritance, polymorphism and magic methodsInheritance and super(), overriding, polymorphism, _private names and @property, magic methods and abstract classes.
- Python comprehensions, generators and decoratorsList, dict and set comprehensions, map, filter, zip, enumerate, key functions, iterators, generators and decorators.
Part 4: Advanced Python & Data
- Python standard library power toolsdatetime parsing and formatting, pathlib and shutil, collections (Counter, defaultdict, namedtuple, deque) and regular expressions.
- Python databases with SQLiteTables and SQL CRUD, sqlite3 connect and commit, ? placeholders, SELECT queries, GROUP BY reports and JOIN.
- Data analysis with NumPy, Pandas and MatplotlibNumPy arrays, Pandas DataFrames, filtering and sorting, groupby, cleaning data, and Matplotlib charts.
- Python APIs, web scraping and FlaskRequests and responses, calling JSON APIs, status codes and timeouts, BeautifulSoup, and Flask routes, templates, forms and JSON APIs.
Part 5: Pro Skills & Capstone Projects
- Python GUI apps with Tkinter and office automationTkinter windows, widgets and layouts, reading input and showing results, after() timers, Excel with openpyxl, Pillow and batch renaming.
- Professional Python: tools and habitsvenv, project structure and PEP 8, type hints and mypy, logging, automated tests with pytest, and Git.