Installing Python and VS Code, and Running Your First File
Install Python and VS Code on Windows, Mac or Linux, check that they work, try the interactive shell and run your first Python file with the Run button and the terminal.
Variables and Data Types: Storing Information
Learn to store information in Python variables, name them with snake_case, change their values, and use the main data types int, float, str, bool and None with type().
Numbers and Math: Bills, Discounts and Percentages
Learn Python arithmetic, floor division, remainders, powers, rounding and the math module, then build a restaurant bill splitter with a discount, GST and fair shares.
Strings: Working with Text and f-strings
Learn to create, slice, clean and search text in Python with string methods, and build neat messages with f-strings, number formatting and padding for a tiffin service.
Taking Input: input() and Type Conversion
Ask the user questions with input(), convert the answers with int(), float(), str() and bool(), avoid the classic "20" + "1" mistake, and build a ticket fare calculator.
Conditions: if, elif and else
Teach your Python programs to make decisions with if, elif and else, comparison operators and and, or, not. You will build a school result checker that turns marks into grades.
More on Functions: *args, **kwargs, lambda and Scope
Write flexible Python functions with keyword arguments, *args, **kwargs and keyword-only parameters, sort data with lambda, understand scope (LEGB) and pass functions to other functions.
Comprehensions: Lists, Dicts and Sets in One Line
Build new lists, dictionaries and sets in one readable line with Python comprehensions, filter with if, choose values with conditional expressions and add up data with generator expressions.
Modules and Packages: import, the Standard Library and pip
Use import, from ... import and as, explore math, random, datetime, statistics and string, write your own module with if __name__ == "__main__", and install packages with pip.
Working with Files: Reading and Writing Text
Read and write text files in Python with open() and with blocks, choose the right mode (r, w, a), loop over lines, handle Hindi text with UTF-8, keep a log and use pathlib.
Error Handling: try, except, else and finally
Handle Python exceptions with try, except, else and finally, read a traceback, raise your own errors, create a custom exception class and build an ATM input loop that never crashes.
Classes and Objects: Modelling Real Things
Learn object-oriented programming in Python with classes, objects, __init__, self and methods. Model train tickets, a bank account with rules and a coach booking system.
Inheritance and Special Methods
Reuse code with inheritance and super(), override methods, and make your objects work with print, len, ==, sorted and + using special methods like __str__, __eq__ and __lt__.
Regular Expressions in Python: Finding Patterns in Text
Use Python's re module to find, check and replace patterns in text. Validate PIN codes, mobile numbers, PAN and email, and pull rupee amounts out of a bank SMS.