Understanding classes and object-oriented programming [Python Tutorial]

Understanding classes and object-oriented programming [Python Tutorial]

Clear Code

2 года назад

125,633 Просмотров

A tutorial about classes and object-oriented programming. I will cover everything you need to create classes, use dunder methods, simple and complex inheritance and how to work with classes and connect objects.

If you want to support me: https://www.patreon.com/clearcode
(You also get lots of perks)

Social stuff:
Twitter - https://twitter.com/clear_coder
Discord - https://discord.com/invite/a5C6pYw2w5

Timestamps:
0:00:00 - Intro
0:16:23 - Class Intro
0:29:00 - Dunder methods
0:45:16 - Class Deep dive
0:58:44 - Classes and scope
1:13:22 - Simple inheritance
1:35:54 - Complex inheritance
1:55:53 - Extra parts

Github:
https://github.com/clear-code-projects/Classes

Pastebin:
intro - https://pastebin.com/uwRrP25a
dunder - https://pastebin.com/WahhZzcw
deep dive - https://pastebin.com/PAU47WdC
scope - https://pastebin.com/k240AUHB
simple inheritance - https://pastebin.com/HmJx37vj
complex inheritance - https://pastebin.com/4HHpmUke
extra - https://pastebin.com/jxiUFZ5K
Ссылки и html тэги не поддерживаются


Комментарии:

OfficialNoob
OfficialNoob - 25.11.2023 17:15

but why cant you just use the for loop with monster.attr = value?

Ответить
ADiTI
ADiTI - 20.11.2023 17:10

Clear and understandable
I appreciate your efforts :)

Ответить
x-X-1-2-3-X
x-X-1-2-3-X - 12.11.2023 12:01

This video made me understand OOP, Thank You!

Ответить
Pat McKinnely
Pat McKinnely - 08.11.2023 07:38

Thank you!!!

Ответить
Declan Gorman
Declan Gorman - 26.10.2023 23:48

Thanks!

Ответить
Nature Window
Nature Window - 25.10.2023 09:02

I wish you would increase the volume.

Ответить
Jodd Vandas
Jodd Vandas - 17.10.2023 23:30

Thank you for this amazing teaching, this lecture is very simple and clear.

Ответить
Ajeje Brazor
Ajeje Brazor - 22.09.2023 07:24

This was amazing! Extra clear and mind-blowing. Thank you for your time and dedication

Ответить
Darren Lefcoe
Darren Lefcoe - 03.09.2023 11:27

Having coded and using classes for many years. And having made video's myself (welcome to watch them). I can say that this video is a very clear and good explanation !!

Ответить
SONU JANGIR
SONU JANGIR - 29.08.2023 08:56

Thank you very much for this helpful video...🎉❤

Ответить
Ismael Santana
Ismael Santana - 25.08.2023 03:16

today I was giving up with programming but your video gave me reasons to keep going! thanks! OOP is not longer a black hole for me

Ответить
Harley O'connor
Harley O'connor - 16.08.2023 23:38

This helped me a lot with making my own games, well done!. Nice clarity and simplicity for really helpful teachings!.

Ответить
Dominik Nowec
Dominik Nowec - 05.08.2023 20:31

so as long as we are using **kwargs we dont need to know mro becouse the order doesnt matter? And we can alternatively use *args insted but then we would have to know mro and pass arguments in the exact same order?

Ответить
Jordan
Jordan - 11.07.2023 22:50

really well explained

Ответить
Narendra Maurya
Narendra Maurya - 04.07.2023 20:24

what is great explaination bro subscribed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!😍😍😍😍😍😍😍😍😍😍

Ответить
Dominik Nowec
Dominik Nowec - 03.07.2023 17:18

isn't that PascalCase for classes insted of camelCase?

Ответить
Jesus Nieto
Jesus Nieto - 21.06.2023 03:36

I had been trying to understand this topic for a while now. All I needed was a good teacher. Thanks!

Ответить
HIDDEN ADHD - my inattentive adhd experience
HIDDEN ADHD - my inattentive adhd experience - 18.06.2023 19:09

THIS WAS GREAT!!

Ответить
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - 14.06.2023 22:12

i think its one of the best oop guides for begginers out there. Very good visual explanation, people often forget that begginers have no clue what is going on and any form of visual explanation(other than code obviously) is extremely helpful

Ответить
Ali Abdullah
Ali Abdullah - 04.06.2023 20:43

Thank you bro for amazing video and knowledge. Superb !!

Ответить
ChArG1nMaLAZ0R
ChArG1nMaLAZ0R - 01.06.2023 23:46

The class attributes dont relate to the attributes in the init method in python. They are like global static variables that the class itself has that are unrelated to the individual instances of the class and which they all share. You can access those variables regardless if you have instances or not and can be called using just the class itself.

Ответить
Phaedrus
Phaedrus - 30.05.2023 22:13

I'm no IT genius, but I think you are explaining the concept of 'self' incorrectly. Self refers to the instantation of the class, the object, not the class. It's very important in OOP to differentiate between the class and the object.

Ответить
Jacob Sola
Jacob Sola - 23.05.2023 20:57

best tutorial

Ответить
Kevin Kim
Kevin Kim - 23.05.2023 19:55

Came here to learn about OOP because CS50 didn't really do it for me at first. Cleared everything, and unlocked OOP completely. Thank you so much.

Ответить
Matthew Ronderos
Matthew Ronderos - 10.05.2023 04:20

thank you for taking the time to make this video

Ответить
Bartek Rymsza
Bartek Rymsza - 08.05.2023 18:53

Thank you so much. This has been very clear and comprehensible. Your tutorials are always of such high quality, and it's incredible that you decide to post them for everyone to see. Please keep up the great work!

Ответить
Powergolf
Powergolf - 16.04.2023 16:54

Amazing teacher. Thank you so much for helping me understand.

Ответить
Ueki Hunter
Ueki Hunter - 03.04.2023 10:57

what text editor you are using?

Ответить
Bixie
Bixie - 27.03.2023 11:22

Can a bug be an object, eg a monster_bug ? 😂

Ответить
Tsukasa1929
Tsukasa1929 - 25.03.2023 22:50

Thanks for the video, really helpful, finally someone that explains OOP with real use, I was always clueless how to work with classes, every video just explains the same over and over with out showing real examples, thanks x1000

Ответить
Archer Darrach
Archer Darrach - 24.03.2023 13:12

Yea k
Gmy
Pvuu😅u

Ответить
sunmai tamang
sunmai tamang - 23.03.2023 10:35

Generally, I do not comment too much bur just wanna say it is the best explaination

Ответить
XYZ XYZ
XYZ XYZ - 22.03.2023 14:17

Thank you for ClearCode explained classes. Man , you have the pedagogical gift !!! Thank you for your generosity for sharing your methods with the rest of the world. Be Blessed and Salutations from France.

Ответить
LowKey253
LowKey253 - 16.03.2023 22:41

plenty of times i copied your code character for character, and i still get red squigglies

Ответить
Jakob Salomonsson
Jakob Salomonsson - 06.03.2023 21:17

Amazing. Thanks a lot!

Ответить
Gualdim
Gualdim - 14.02.2023 01:46

Just brilliant!!! Thank you man!

Ответить
George Ker
George Ker - 12.02.2023 23:43

Nice clarity and simplicity for really helpful teachings!

Ответить
Андрій Городній
Андрій Городній - 10.02.2023 13:01

The best Python OOP explanation ever!

Ответить
FloSrv
FloSrv - 27.01.2023 19:43

Thank you so much for your clear explanations! Would you think it's ok to name a foe with camelcase without uppercase at the beginning? Like eliteTroll for instance? i really like camelcase style and wish to use it more on other assets without confuse python with classes

Ответить
timsim83
timsim83 - 20.01.2023 05:15

Oh snap-OOP explained in terms of mtg! 👀 Squirrel!

Ответить
Dzmitry Motuz
Dzmitry Motuz - 06.01.2023 03:44

Beautiful. Thank you!

Ответить
X ZEX
X ZEX - 29.12.2022 12:38

why why why I did not see this tutorials 7 months ago , I really want to re-learn python

Ответить
SkkiD
SkkiD - 27.12.2022 18:45

agora sim vai entrar OOP na cabeça, obrigado pelo tutorial!

Ответить
5 Jaguar
5 Jaguar - 01.12.2022 21:30

You have a clear voice and the way you explain things is well thought out. Thank you

Ответить
A. Rowley
A. Rowley - 18.11.2022 22:28

Maybe the best Python tutorial I've seen - thanks so much!!!!!

Ответить