Free Online Course · Self-paced
Python Tutorial for Beginners (Hands-On)
Free, complete Python tutorial for beginners - variables, strings, lists, dicts, control flow, OOP, file I/O, error handling, regex, concurrency, and Flask, with a full index of every linked hands-on lesson for Python 3.10+.
- 167 parts
- ~1173 min total
- Beginner to Intermediate
- Updated Jun 2026
Python is the most-taught programming language in the world for good reason: it reads like pseudocode, scales from one-line scripts to massive ML systems, and has a battery-included standard library that covers 90% of common tasks. This tutorial takes you from variables and print() all the way to running Flask web apps - the long way around, with every fundamental covered.
We start with functions and basic syntax, then walk through every data type Python ships (strings, numbers, lists, tuples, sets, dicts), control flow, OOP (classes, dataclasses, inheritance), error handling, file I/O (CSV, JSON, YAML, ZIP), regex, subprocesses, concurrency (threading and multiprocessing), and finally a complete Flask web app. Every chapter is short, every snippet is runnable in the Python REPL, and every example was tested on Python 3.11+.
The chapter list on this page is the full course index: every article that uses the Python lesson sidebar is linked here. On other Python pages, the sidebar shows a shorter “spine” of core topics so navigation stays light; use this hub whenever you need the complete list.
Click Start the course to begin with the getting-started chapter, or jump to the topic you need - Lists, Tuples and Sets, Dictionaries, and Object-Oriented Python are the most-bookmarked. If you finish this course and want to specialize, the next courses are /pandas-tutorial/ (data analysis) and /python-pandas-tutorial/ (deeper Pandas).
What you'll learn
- Write idiomatic Python using variables, strings, numbers, and operators correctly
- Use the four core collections (list, tuple, set, dict) and pick the right one for each job
- Master control flow - if/else, ternary, match/case, for/while loops, comprehensions
- Build functions, classes, dataclasses, and use inheritance / generators / decorators
- Read and write files (CSV, JSON, YAML, ZIP), call subprocesses, and parse arguments
- Handle errors, log properly, and use multithreading / multiprocessing
- Build your first Flask web application
Prerequisites
- Python 3.10+ installed locally (3.11 or 3.12 recommended)
- Comfortable on the command line
- Any code editor (VS Code or PyCharm Community recommended)
Syllabus
19 chapters · 167 lessons · ~1173 min of reading
-
1 Getting Started 9 lessons
- Part 1 Beginner tips for learning Python 7 min read
- Part 2 Python functions explained 7 min read
- Part 3 Call functions in Python 9 min read
- Part 4 Lambda (anonymous) functions 6 min read
- Part 5 Create and publish a Python package 18 min read
- Part 6 requirements.txt - manage dependencies 8 min read
- Part 7 Install a package directly from GitHub 8 min read
- Part 8 Multiline comments 5 min read
- Part 9 Line continuation 7 min read
-
2 Variables, Numbers, Strings 24 lessons
- Part 10 Check the type of a variable 8 min read
- Part 11 Print variables (f-strings and beyond) 5 min read
- Part 12 Python numbers - int, float, complex 7 min read
- Part 13 String formatting (f-strings, format(), %) 6 min read
- Part 14 Concatenate strings 5 min read
- Part 15 Extract a substring 5 min read
- Part 16 Split a string 5 min read
- Part 17 Check if a string contains a substring 6 min read
- Part 18 str.startswith() method 4 min read
- Part 19 str.strip() and friends 6 min read
- Part 20 Reverse a string 5 min read
- Part 21 Compare strings 7 min read
- Part 22 Multi-line strings 8 min read
- Part 23 Global variables 6 min read
- Part 24 Delete a variable 7 min read
- Part 25 None and null checks 8 min read
- Part 26 str.casefold() for case-insensitive text 4 min read
- Part 27 Check if a string is an integer 6 min read
- Part 28 Mask user input (asterisks) 6 min read
- Part 29 Copy a string safely 7 min read
- Part 30 str.isupper() and case checks 4 min read
- Part 31 Unique characters in a string 4 min read
- Part 32 Append to strings efficiently 6 min read
- Part 33 Replace text in a file 4 min read
-
3 Operators, Conditions, Pattern Matching 6 lessons
- Part 34 Python operators (arithmetic, comparison, logical, bitwise) 7 min read
- Part 35 if / elif / else 11 min read
- Part 36 One-line if/else 7 min read
- Part 37 Ternary operator 6 min read
- Part 38 switch/case equivalents in Python 7 min read
- Part 39 match / case (structural pattern matching) 20 min read
-
4 Loops and Iteration 13 lessons
- Part 40 for loop 5 min read
- Part 41 One-line for loops (comprehensions) 5 min read
- Part 42 while loop 8 min read
- Part 43 while with multiple conditions 6 min read
- Part 44 Loop N times 5 min read
- Part 45 Loop through lists 8 min read
- Part 46 break statement 8 min read
- Part 47 continue statement 7 min read
- Part 48 pass statement 8 min read
- Part 49 pass vs break vs continue 4 min read
- Part 50 range() function 6 min read
- Part 51 enumerate() 6 min read
- Part 52 Reverse range() patterns 4 min read
-
5 Lists, Tuples and Sets 19 lessons
- Part 53 Python lists explained 8 min read
- Part 54 list vs set vs tuple vs dictionary 8 min read
- Part 55 list.pop() 9 min read
- Part 56 list.extend() 6 min read
- Part 57 append() vs extend() 6 min read
- Part 58 Remove elements from a list 6 min read
- Part 59 Concatenate lists 8 min read
- Part 60 Flatten a nested list 4 min read
- Part 61 Sort a list 6 min read
- Part 62 Copy a list (shallow vs deep) 7 min read
- Part 63 Python tuples 8 min read
- Part 64 Python sets 7 min read
- Part 65 Add to a set 7 min read
- Part 66 Set intersection 15 min read
- Part 67 Set difference 9 min read
- Part 68 Set symmetric difference 6 min read
- Part 69 Length of a set 4 min read
- Part 70 Print a list in reverse with range() 4 min read
- Part 71 Join lists together 5 min read
-
6 Dictionaries 10 lessons
- Part 72 Python dictionaries explained 7 min read
- Part 73 Add to a dictionary 5 min read
- Part 74 Extend a dictionary 6 min read
- Part 75 Nested dictionaries 12 min read
- Part 76 Sort a dict by key 7 min read
- Part 77 Sort a dict by value 6 min read
- Part 78 Remove a key from a dict 6 min read
- Part 79 Merge two dicts 7 min read
- Part 80 Nested dictionary patterns 7 min read
- Part 81 Slice or partition dictionary data 4 min read
-
7 Functions and Arguments 6 lessons
-
8 Functional Tools and Comprehensions 7 lessons
- Part 88 List comprehensions 10 min read
- Part 89 map() function 6 min read
- Part 90 filter() function 6 min read
- Part 91 zip() function 8 min read
- Part 92 any() — test if any item is true 7 min read
- Part 93 all() — test if every item is true 5 min read
- Part 94 len() — length of sequences and collections 6 min read
-
9 Object-Oriented Python 8 lessons
- Part 95 Define a class 7 min read
- Part 96 Constructors (__init__) 10 min read
- Part 97 @classmethod 8 min read
- Part 98 @staticmethod 6 min read
- Part 99 super() and inheritance 6 min read
- Part 100 @dataclass 10 min read
- Part 101 Enum types 7 min read
- Part 102 The @deleter property decorator 5 min read
-
11 File I/O 13 lessons
- Part 109 Check if a file exists 7 min read
- Part 110 Write to a file 5 min read
- Part 111 writelines() method 4 min read
- Part 112 Delete a file 7 min read
- Part 113 Read and write CSV 6 min read
- Part 114 Read YAML into a dict 6 min read
- Part 115 os.path.join() 7 min read
- Part 116 Create nested directories 6 min read
- Part 117 Get a file's extension 4 min read
- Part 118 Get a file's size 6 min read
- Part 119 Work with zip archives 7 min read
- Part 120 Persistent dict-like storage (shelve) 5 min read
- Part 121 Unix password database (pwd) 6 min read
-
12 Regex, Dates and Utilities 8 lessons
- Part 122 Python regex (re module) 8 min read
- Part 123 datetime basics 9 min read
- Part 124 Convert datetime to timestamp 5 min read
- Part 125 Generate UUIDs 6 min read
- Part 126 Measure execution time 6 min read
- Part 127 Generate sample GPS coordinates 6 min read
- Part 128 Get the user home directory 5 min read
- Part 129 Date math (months ago) 3 min read
-
13 Subprocess, CLI and HTTP 6 lessons
-
15 Linting, testing, and packaging extras 5 lessons
-
16 Data structures and algorithms 3 lessons
-
17 NumPy, Matplotlib, PyTorch, and related snippets 13 lessons
- Part 149 Matplotlib basics 8 min read
- Part 150 pyplot.figure() patterns 9 min read
- Part 151 plt.vlines() for vertical lines 3 min read
- Part 152 Seaborn scatter plots 6 min read
- Part 153 NumPy random number examples 10 min read
- Part 154 NumPy assignment and broadcasting pitfalls 4 min read
- Part 155 Shuffle two NumPy arrays in sync 5 min read
- Part 156 Combine two-column matrices 5 min read
- Part 157 Sort names in reverse alphabetic order 5 min read
- Part 158 Lowercase an entire DataFrame 3 min read
- Part 159 Concatenate tensors in PyTorch 7 min read
- Part 160 Circular color gradients in Python 7 min read
- Part 161 Facebook AI Similarity Search (Faiss) API 8 min read
-
18 Concurrency 2 lessons

