ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Python Classes & Objects Explained | Complete Beginner's Guide

Автор: Start Coding Today

Загружено: 2025-12-29

Просмотров: 73

Описание: 0:00
Have you ever heard Python programmers throwing around words like classes and objects and just nodded along, feeling like you missed an important memo?
You’re in exactly the right place.

0:11
In the next few minutes, we’ll break all that jargon down into a simple, powerful tool you can start using right away.

0:20
Here’s the big question: a program is just lines of code, right? Text and logic.
So how does it represent a real-world thing like a person, a car, or a bank account?

0:34
The answer: classes and objects. That’s why they were invented.

The Game Plan

0:41
We’ll cover:

The difference between a blueprint and a real object

Creating an empty blueprint

Using it to make real objects

Giving objects unique data

Teaching objects to perform actions

0:58
By the end, your code will feel completely different.

Classes vs Objects

1:01
Here’s the most important idea in all of object-oriented programming: the difference between a plan and the thing you build from it.

1:18

Class → the blueprint or rulebook.
Example: A student class says:

“Every student must have a name and an age.”

A class alone does nothing. It’s just instructions.

1:38

Object → the real thing.
Example: A student like Ali or Sarah.

1:52
Analogy:

Class = blueprint, Object = house you can live in

Class = recipe, Object = cake you can eat

Creating a Class

2:14

class Student:
pass


class → tells Python we’re making a blueprint

Student → name of the class (capitalize by convention)

pass → placeholder for details we’ll add later

2:57
We now have a blueprint. Empty, but valid.

Creating Objects

3:08

ali = Student()
sara = Student()


Left → variable holding the object

Right → class name + parentheses → Python creates a new object

3:48
Each object is independent.

Ali, Sara, Ahmed → all separate, same blueprint

Analogy: a mold making toy cars; one breaks, the others are fine

Adding Data with _init_ and self

5:00
To give objects unique information, we use:

_init_ → the setup function called automatically

self → refers to the specific object being created

5:20

class Student:
def __init__(self, name, age):
self.name = name
self.age = age


self.name = name → stores incoming name inside this object only

Why It Works

5:49

ally = Student("Ally", 12)
sarah = Student("Sarah", 11)


self ensures Ally’s data stays with Ally, Sarah’s with Sarah

Data never mixes

Adding Behavior

6:19

class Student:
def __init__(self, name, age):
self.name = name
self.age = age

def introduce(self):
print(f"My name is {self.name} and I am {self.age} years old")


Functions inside a class → methods

self gives methods access to the object’s data

Calling ally.introduce() prints Ally’s info, sarah.introduce() prints Sarah’s

Factory Analogy

7:15

Class → factory blueprint

Object → product off the assembly line

_init_ → setup process customizing each product

self → unique label for each product

7:45
You’ve built a complete student model, from blueprint to functioning object.

7:47
Now think bigger: cars, bank accounts, playlists, video game characters… what blueprints could you design and bring to life in your code? 🚀

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Python Classes & Objects Explained | Complete Beginner's Guide

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

Как бы я БЫСТРО выучил Python (если бы мог начать заново)

Как бы я БЫСТРО выучил Python (если бы мог начать заново)

Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3

Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3

Как учиться быстро и самому? На примере языков  программирования.

Как учиться быстро и самому? На примере языков программирования.

ООП На Простых Примерах | Объектно-Ориентированное Программирование

ООП На Простых Примерах | Объектно-Ориентированное Программирование

Python OOP Demystified | Object-Oriented Programming Explained#Python #OOP #Programming

Python OOP Demystified | Object-Oriented Programming Explained#Python #OOP #Programming

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

У меня ушло 10+ лет, чтобы понять то, что я расскажу за 11 минут

У меня ушло 10+ лет, чтобы понять то, что я расскажу за 11 минут

Разжёванный курс по Linux для чайников.  Часть 1

Разжёванный курс по Linux для чайников. Часть 1

Курс Python с Абсолютного нуля! [12 часов из 80] Python курс - качественный старт для начинающих!

Курс Python с Абсолютного нуля! [12 часов из 80] Python курс - качественный старт для начинающих!

Intermediate Python | Lesson 15: Working with Directories & File System Operations

Intermediate Python | Lesson 15: Working with Directories & File System Operations

Programming ▫️ Coding ▫️ Hacking ▫️ Designing Music 🦠

Programming ▫️ Coding ▫️ Hacking ▫️ Designing Music 🦠

ВСЯ СТРУКТУРА АНГЛИЙСКОГО ЯЗЫКА ЗА 35 МИНУТ. ВЫУЧИТЬ АНГЛИЙСКИЙ С НУЛЯ. УРОКИ АНГЛИЙСКОГО.

ВСЯ СТРУКТУРА АНГЛИЙСКОГО ЯЗЫКА ЗА 35 МИНУТ. ВЫУЧИТЬ АНГЛИЙСКИЙ С НУЛЯ. УРОКИ АНГЛИЙСКОГО.

AI Spending Delivers Mixed Results to Stocks | Bloomberg Tech 1/29/2026

AI Spending Delivers Mixed Results to Stocks | Bloomberg Tech 1/29/2026

Python Methods Explained | Instance, Class & Static Methods#Python #Programming #OOP

Python Methods Explained | Instance, Class & Static Methods#Python #Programming #OOP

Disjoint Set Union Explained | Union-Find Data Structure in C++#C++ #DataStructures #Algorithms

Disjoint Set Union Explained | Union-Find Data Structure in C++#C++ #DataStructures #Algorithms

Для Чего РЕАЛЬНО Нужен был ГОРБ Boeing 747?

Для Чего РЕАЛЬНО Нужен был ГОРБ Boeing 747?

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Как запоминать всё, как японские студенты (и учиться меньше)

Как запоминать всё, как японские студенты (и учиться меньше)

ChatGPT in a kids robot does exactly what experts warned.

ChatGPT in a kids robot does exactly what experts warned.

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]