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 web apps. 70+ runnable lessons covering Python 3.10+.
- 111 parts
- ~1245 min total
- Beginner to Intermediate
- Updated May 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 + 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+.
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
15 chapters · 111 lessons · ~1245 min of reading
-
1 Getting Started 7 lessons
- Part 1 Beginner tips for learning Python 7 min read
- Part 2 Python functions explained 10 min read
- Part 3 Call functions in Python 9 min read
- Part 4 Lambda (anonymous) functions 11 min read
- Part 5 Create and publish a Python package 19 min read
- Part 6 requirements.txt - manage dependencies 5 min read
- Part 7 Install a package directly from GitHub 4 min read
-
2 Variables, Numbers, Strings 13 lessons
- Part 8 Check the type of a variable 13 min read
- Part 9 Print variables (f-strings and beyond) 8 min read
- Part 10 Python numbers - int, float, complex 6 min read
- Part 11 String formatting (f-strings, format(), %) 14 min read
- Part 12 Concatenate strings 6 min read
- Part 13 Extract a substring 10 min read
- Part 14 Split a string 5 min read
- Part 15 Check if a string contains a substring 21 min read
- Part 16 str.startswith() method 8 min read
- Part 17 str.strip() and friends 8 min read
- Part 18 Reverse a string 9 min read
- Part 19 Compare strings 6 min read
- Part 20 Multi-line strings 8 min read
-
3 Operators, Conditions, Pattern Matching 6 lessons
- Part 21 Python operators (arithmetic, comparison, logical, bitwise) 19 min read
- Part 22 if / elif / else 14 min read
- Part 23 One-line if/else 9 min read
- Part 24 Ternary operator 18 min read
- Part 25 switch/case equivalents in Python 9 min read
- Part 26 match / case (structural pattern matching) 20 min read
-
4 Loops and Iteration 12 lessons
- Part 27 for loop 14 min read
- Part 28 One-line for loops (comprehensions) 14 min read
- Part 29 while loop 10 min read
- Part 30 while with multiple conditions 6 min read
- Part 31 Loop N times 7 min read
- Part 32 Loop through lists 16 min read
- Part 33 break statement 7 min read
- Part 34 continue statement 7 min read
- Part 35 pass statement 11 min read
- Part 36 pass vs break vs continue 4 min read
- Part 37 range() function 13 min read
- Part 38 enumerate() 16 min read
-
5 Lists, Tuples and Sets 16 lessons
- Part 39 Python lists explained 12 min read
- Part 40 list vs set vs tuple vs dictionary 6 min read
- Part 41 list.pop() 11 min read
- Part 42 list.extend() 6 min read
- Part 43 append() vs extend() 6 min read
- Part 44 Remove elements from a list 9 min read
- Part 45 Concatenate lists 6 min read
- Part 46 Flatten a nested list 9 min read
- Part 47 Sort a list 10 min read
- Part 48 Copy a list (shallow vs deep) 8 min read
- Part 49 Python tuples 9 min read
- Part 50 Python sets 9 min read
- Part 51 Add to a set 6 min read
- Part 52 Set intersection 15 min read
- Part 53 Set difference 9 min read
- Part 54 Set symmetric difference 14 min read
-
6 Dictionaries 8 lessons
- Part 55 Python dictionaries explained 13 min read
- Part 56 Add to a dictionary 7 min read
- Part 57 Extend a dictionary 3 min read
- Part 58 Nested dictionaries 12 min read
- Part 59 Sort a dict by key 7 min read
- Part 60 Sort a dict by value 6 min read
- Part 61 Remove a key from a dict 7 min read
- Part 62 Merge two dicts 6 min read
-
8 Functional Tools and Comprehensions 4 lessons
-
11 File I/O 11 lessons
- Part 84 Check if a file exists 6 min read
- Part 85 Write to a file 15 min read
- Part 86 writelines() method 8 min read
- Part 87 Delete a file 9 min read
- Part 88 Read and write CSV 13 min read
- Part 89 Read YAML into a dict 6 min read
- Part 90 os.path.join() 6 min read
- Part 91 Create nested directories 5 min read
- Part 92 Get a file's extension 11 min read
- Part 93 Get a file's size 5 min read
- Part 94 Work with zip archives 22 min read
-
13 Subprocess, CLI and HTTP 6 lessons
-
14 Concurrency 2 lessons

