BeginnerLesson 11 of 1935 min 路 hands-on
Classes and OOP
Part of the Python course
Welcome to one of the bigger ideas in Python. So far you have used built-in tools (strings, lists, dicts, functions) to shape data. In this lesson you will learn to design your own kinds of things by writing a class, and you will see how a class lets you bundle data and behaviour together. Take your time, this lesson rewards reading slowly.
The editor on your right is open with main.py. Click the play button above the file. You should see this in the output panel:
Want to learn Python Classes and OOP in a real environment?
Click below, get a fresh Linux box with Python ready to go, and work through Classes and OOP hands-on with an AI tutor that knows your code.
Start this lessonClasses and OOPWhat you'll learn
- Class definition
- __init__
- Instance attributes
- Class attributes
- Methods
- __repr__
Read this lesson in your language
All lessons in this course
19 lessons- 1Hello, Python20 min
- 2Numbers and Strings25 min
- 3Asking the User a Question15 min
- 4Control Flow30 min
- 5Lists and Tuples30 min
- 6Dictionaries and Sets30 min
- 7Functions30 min
- 8Comprehensions25 min
- 9Files and IO30 min
- 10Modules and Packages30 min
- 11Classes and OOP35 min
- 12Inheritance and Composition30 min
- 13Exception Handling30 min
- 14Iterators and Generators30 min
- 15Decorators30 min
- 16Context Managers25 min
- 17Concurrency: Threads and Async40 min
- 18Testing with pytest35 min
- 19Packaging and Deployment35 min
Explore other courses
Go
20 lessons 路 12.3h
React
17 lessons 路 10.2h
Linux
17 lessons 路 8.5h
Docker
13 lessons 路 6.6h
Git
13 lessons 路 5.9h
Kubernetes
14 lessons 路 8h
Ansible
12 lessons 路 6.1h
Bash
12 lessons 路 5.7h
Helm
10 lessons 路 5.4h
GitLab CI
11 lessons 路 5.8h
Jenkins
11 lessons 路 5.3h
PostgreSQL
14 lessons 路 7.6h
MySQL
13 lessons 路 6.8h
Web
14 lessons 路 5.9h
TypeScript
18 lessons 路 7.7h
Vibe Coding
12 lessons 路 5.8h
Prompt Engineering
11 lessons 路 6.2h
Vibe Coding: Fundamentals
12 lessons 路 4.5h
Vibe Coding: Prototype to Production
12 lessons 路 5.5h
Vibe Coding: Multi-Agent Engineering
12 lessons 路 5.3h
Vibe Coding: Advanced Engineering
12 lessons 路 7.3h
