Перейти к содержимому

MAGIC METHODS in PYTHON | Python for Beginners #python #code #pythonprogramming #abstract

BracesAndSemicolons

0:00 / 0:00

MAGIC METHODS in PYTHON | Python for Beginners #python #code #pythonprogramming #abstract

8 просмотров · 1 г. назад
BracesAndSemicolons
4,76 тыс. подписчиков
8 просмотров · 1 г. назад
In this Python tutorial, we take a hands-on, beginner-friendly journey through the world of magic methods (also known as dunder methods) — using a fun and relatable example: a 🎬 Movie class! You'll learn how to make your custom Python objects behave like built-in types using special double-underscore methods like: 🔍 What You'll Learn: __init__: How objects are created _str_ : Pretty printing __eq__: Comparing objects __len__: Making objects work with len() __lt__, __gt__: Sorting and comparing __contains__: Using in with custom objects 🧠 We build up the Movie class step by step — testing each magic method as we go, and explaining not just how it works, but why and when to use it. SOURCE CODE: https://github.com/bhumikapandey1992/... Recommended books : 1) https://amzn.to/4o4TxmP 2) https://amzn.to/46Q8XoA 3) https://amzn.to/3IDPTjq #python #pythonforbeginners #code #learning #learnpython #Python #OOP #Polymorphism #PythonTutorial #ObjectOrientedProgramming