Python tutorial
Learn Python with Interactive Tutorials
A beginner Python course: syntax, lists, functions, and files. Then NumPy, Pandas, Django, and a first machine-learning model. Every example runs in the browser at /try.
300+ chapters. The editor is /try.
Course overview
Start at intro, or jump to lists, Django, or a project.
Start
Run your first program
Intro · Syntax · VariablesData
Lists, tuples, sets, dicts
Lists · Tuples · DictsControl
Decisions and loops
If · While · ForFunctions
Reuse work without copy-paste
Functions · Lambda · ScopeOOP
Classes and inheritance
Classes · Inherit · ModulesFiles
Read, write, JSON, CSV
Files · JSON · PIPData science
Arrays, tables, and models
NumPy · Pandas · MLWeb
Django backends you can run
Django · MySQLDSA
Search, sort, trees, graphs
Stacks · Trees · SortPractice
100+ copy-and-run snippets
Strings · Lists · NumPyProjects
Ten programs you can finish
Guess · Quiz · CSVBootcamp
Question, hint, solution, Check
Labs · Hints · CheckWhat you get in this tutorial
- print() and plots. The right pane is stdout, plus Matplotlib when you call show().
- Its own editor. Lessons are under /tutorial. The editor is /try.
- A chapter path. Read, change the example, press Next.
Lesson sequence
Every Python lesson, in order.
- 01Intro
- 02Get Started
- 03Syntax
- 04Comments
- 05Variables
- 06Variable Names
- 07Assign Multiple
- 08Output Variables
- 09Global Variables
- 10Data Types
- 11Numbers
- 12Casting
- 13Strings
- 14Slicing Strings
- 15Modify Strings
- 16Concatenate
- 17Escape Characters
- 18String Methods
- 19Booleans
- 20Operators
- 21Lists
- 22Access Lists
- 23Change Lists
- 24Add List Items
- 25Remove List Items
- 26Loop Lists
- 27List Comprehension
- 28Sort Lists
- 29Copy Lists
- 30Join Lists
- 31List Methods
- 32Tuples
- 33Access Tuples
- 34Update Tuples
- 35Unpack Tuples
- 36Loop Tuples
- 37Join Tuples
- 38Tuple Methods
- 39Sets
- 40Access Sets
- 41Add Set Items
- 42Remove Set Items
- 43Loop Sets
- 44Join Sets
- 45Set Methods
- 46Dictionaries
- 47Access Dicts
- 48Change Dicts
- 49Add Dict Items
- 50Remove Dict Items
- 51Loop Dicts
- 52Copy Dicts
- 53Nested Dicts
- 54Dict Methods
- 55If...Else
- 56Match
- 57While Loops
- 58For Loops
- 59Functions
- 60Lambda
- 61Arrays
- 62OOP
- 63Classes/Objects
- 64Inheritance
- 65Iterators
- 66Polymorphism
- 67Scope
- 68Modules
- 69Dates
- 70Math
- 71JSON
- 72RegEx
- 73PIP
- 74Try...Except
- 75String Formatting
- 76User Input
- 77VirtualEnv
- 78File Handling
- 79Read Files
- 80Write Files
- 81Delete Files
- 82DSA
- 83NumPy
- 84Pandas
- 85Matplotlib
- 86Machine Learning
- 87Django
- 88MySQL
- 89MongoDB
- 90Examples
- 91Projects