You are declaring instance attributes outside of the __init__ method, which is not ideal. You can just create them with a value of None, and then set them in the draw method. If you never call the draw method, that means the attributes will never be initialized (set) and thus, do not exist.
@@PythonSimplified Python does not really care however and lets you do all of these things. You can declare variables anywhere you want, without specifying a type even. But it's very prone to errors. I've had to deal with something like this myself where it took me a while until I figured out why my attribute was not declared even though I did declare it. It was not in the __init__ method...
I would also create getter methods for any property you want to be public to the consumer of the class. This is also not a place where Python excels because it doesn't have access modifiers and pretty much everything is public. But it is customary to prefix an underscore to show a property or method should be private.
Visuals are very important when learning, for a lot of people. This was a great way to show off classes and although I have been using Python a while, I feel a lot more comfortable with some things I did not know before (like the super required in inheritance!) Fantastic video!
Thank you so much Vinny!!! So happy you liked this tutorial, and I agree with you 100%! 😀 Initially I was planning to start this exercise in a fully functional car game. The red car image would have been the enemy vehicle, and we would have implemented changes in speed and associating different audio files with different vehicle classes. I realized eventually that it's a bit too much so I decided to keep it simple. (We might still do it in a live stream though! 😉) Cheers! and thanks for the comment! :)
Thank you! You're a great explainer! You seem like you test your tutorials ahead, so you don't get tripped up on small details like many do when doing tutorials.
Good morning! I'm enjoying learning from such a skilled little snake charmer. Please feel free to keep sending those homework assignments my way - practice makes python! Thank you Mariya! 😊😃😛😉
Thank you for continued content. Would love a video that goes over how how to self-learn new python modules! Ideas would include how to get used to reading python module documentation, what to google, how to find examples etc.., how to start playing with a new module etc.. Hope you respond whether you think this is a good or bad idea/or any thoughts in general. Thanks!
In pygame or python ursina or cave engine it is more effective to write the classes like "class MY_CLASS(WHAT_MY_IS):". The reason: Game engines like Ursina, PyGame or Cave call predefined instances such as “Entity”, “Text”, “Animation” or simple “Scene”. This means that if you write larger code, sooner or later type problems will arise when recognizing and reading the instances if this is not stated directly. At the same time, these are able to use the update definition with the delta time and update themselves. If you don't specify anything there, the update function will only work to a limited extent there or at least only if you integrate it somewhere else, which will end up eating up a lot of performance and Python is a bit slower in gaming anyway. It would also make the code easier to understand and read if you use variables or values that are as short as possible than the actual string or value itself. Example: plc_t='police_car_texture0.png' instead of police_car_texture='police_car_texture0.png'.
Thank you for such an informative video. But everyone is talking about OOP, I wish we could see a functional programming exercise. I wish you could talk about paradigms and create a functional programming tutorial. I don't want peace, I want trouble!
Hey dear! I just wanted to ask if you could provide us with your opinion about the new function of Windows 11 It is called "Recall" or something else. It screenshots your screen every 5 seconds... Have a great time!
It's probably just another way for Bill Gates to spy on you 😉 hahaha But on a deeper level, I believe they try to model your computer usage and learn your behavior. If they collect enough data, they can estimate you next move quite accurately. They also know that most people will let them do so, because installing and maintaining Linux is complex for most individuals. If they had an "apples to apples" competition - they wouldn't do something that shady 🙃
Hello from Greece! Thanks for the tutorial!! One question: is pygame worth it or is it outdated? What about Python Arcade or similar frameworks? Thanks again!
Ohh .I wish somebody bothered to explain it to me as from where I could start the journey! Or the sequence it would save me so much time and frustration 😦😔 TH-cam is bombarded with so many videos 😭
Hey Py~Lady! shout-Out fr~ @MI i jst watchD yr 'Next Wave' show (radiant & composed az ever ) 'With AI, Are Coding Jobs at Risk? ft. Python Simplified' i coMentD 2U there 2: Hiya 'Py Lady'! (Mariya Sha)
I personally find it much more intuitive than C++ and C#... I guess I'm not a big fan of Header files, declaring stuff and figuring out why the code won't compile if the info in .cpp and .h files don't match 🙃 I think the only downside in the Python way, as mentioned by Badger in the live chat, is that Python private members are not really private. Other than that, I'm a happy camper 😀
@@PythonSimplified yeah, you may be right, everyone have their preference, I started my journey with Python and I used to love it, now I'm a Kotlin/Android developer and trust me I would never like to return to python.
@@PythonSimplified well, kotlin is modern Java and it has replaced java in all manners. "Write once, run anywhere." was a slogan for Java but now It's the Kotlin era. Have you heard about Kotlin/Compose Multiplatform?
You are declaring instance attributes outside of the __init__ method, which is not ideal. You can just create them with a value of None, and then set them in the draw method. If you never call the draw method, that means the attributes will never be initialized (set) and thus, do not exist.
100%!!! Thank you for the awesome tip! 😀😀😀
@@PythonSimplified Python does not really care however and lets you do all of these things. You can declare variables anywhere you want, without specifying a type even. But it's very prone to errors. I've had to deal with something like this myself where it took me a while until I figured out why my attribute was not declared even though I did declare it. It was not in the __init__ method...
I would also create getter methods for any property you want to be public to the consumer of the class. This is also not a place where Python excels because it doesn't have access modifiers and pretty much everything is public. But it is customary to prefix an underscore to show a property or method should be private.
Thank you so much. That replacing "self" with "vehicle" really cleared a lot of things
Visuals are very important when learning, for a lot of people. This was a great way to show off classes and although I have been using Python a while, I feel a lot more comfortable with some things I did not know before (like the super required in inheritance!) Fantastic video!
Thank you so much Vinny!!! So happy you liked this tutorial, and I agree with you 100%! 😀
Initially I was planning to start this exercise in a fully functional car game. The red car image would have been the enemy vehicle, and we would have implemented changes in speed and associating different audio files with different vehicle classes. I realized eventually that it's a bit too much so I decided to keep it simple. (We might still do it in a live stream though! 😉)
Cheers! and thanks for the comment! :)
Agrē! "Visuals are very important when learning", &
'PythonSimplified' cŕtainLy bring'z the "visuals"
w/hŕ evŕ rādiant smile
@@PythonSimplified Cannot wait to see what you create next then!
Thank you! You're a great explainer! You seem like you test your tutorials ahead, so you don't get tripped up on small details like many do when doing tutorials.
Pure teaching talent.
You are such a perfect teacher. So easy to understand you. Even though I am more of a Java, c and c++ developer.
Good morning! I'm enjoying learning from such a skilled little snake charmer. Please feel free to keep sending those homework assignments my way - practice makes python! Thank you Mariya! 😊😃😛😉
Спасибо, Маша! Отлично обхяснила. Даже я что-то понял из ООП. Пожалуй вернусь к этому упражнению после прохождения курса по ООП на степике!
Got yourself a new subscriber.
Welcome aboard! 😀
This is great! Going to rewatch later when I get on my computer...
I hope you have lots of fun and this video will give you a bunch of cool ideas for personal projects! 😀
I really love your content- you have a gift for teaching thank you for sharing
Thank you for continued content. Would love a video that goes over how how to self-learn new python modules! Ideas would include how to get used to reading python module documentation, what to google, how to find examples etc.., how to start playing with a new module etc..
Hope you respond whether you think this is a good or bad idea/or any thoughts in general. Thanks!
Woow best OOP lesson that i have ever seen. 🥰
you make learning fun
In pygame or python ursina or cave engine it is more effective to write the classes like "class MY_CLASS(WHAT_MY_IS):". The reason: Game engines like Ursina, PyGame or Cave call predefined instances such as “Entity”, “Text”, “Animation” or simple “Scene”. This means that if you write larger code, sooner or later type problems will arise when recognizing and reading the instances if this is not stated directly. At the same time, these are able to use the update definition with the delta time and update themselves. If you don't specify anything there, the update function will only work to a limited extent there or at least only if you integrate it somewhere else, which will end up eating up a lot of performance and Python is a bit slower in gaming anyway. It would also make the code easier to understand and read if you use variables or values that are as short as possible than the actual string or value itself. Example: plc_t='police_car_texture0.png' instead of police_car_texture='police_car_texture0.png'.
You down with OOP? Yea, you inherit me!
I personally couldn't have made it a better explanation Maryia
Thank you Mariya for another great content!!!
I think I found the channel I'll be using to research Python 👀suddenly it's far easier to pay attention and learn
please make a few series on OOP, for example why do we actually need encapsulation.
Omg that hair 🤤🤤🤤 single? Haha
i miss you so much ❤️
please stay active 🙏 we love your content 😍
Thanks Maria, i think i have to go over again.
Keep it up🙂
Drop the mic girl , this content is gold , thanks !
Thanks for posting!
Thank you for the amazing content! Love's me some pygame.
Thank you for such an informative video. But everyone is talking about OOP, I wish we could see a functional programming exercise. I wish you could talk about paradigms and create a functional programming tutorial. I don't want peace, I want trouble!
Hi can you make a video for python selenium?
Nice intro music!
Waiting for great upcoming session
I hope you enjoyed it! (or will enjoy it! 😀)
Yea you always teach us exceptional thing in very simplified
I don't have money more for lesson python
Can you explain about abstraction?
cool, but is there a simple way of making them not touch or cover each other?
thanks for the video!!
helpful 10x Mariya. 😉. Let's rolllll
Great Video 🙂
Спасибо за видео :)
Simplification Pythonified!
Excellent .
Hey dear!
I just wanted to ask if you could provide us with your opinion about the new function of Windows 11
It is called "Recall" or something else. It screenshots your screen every 5 seconds...
Have a great time!
It's probably just another way for Bill Gates to spy on you 😉 hahaha
But on a deeper level, I believe they try to model your computer usage and learn your behavior. If they collect enough data, they can estimate you next move quite accurately. They also know that most people will let them do so, because installing and maintaining Linux is complex for most individuals. If they had an "apples to apples" competition - they wouldn't do something that shady 🙃
Colour is brittish, cool 🙂
Yup! and also Canadian! 🍁🫎
@@PythonSimplified hm, I didn't acually know that Mariya
and Australian.
Hello from Greece!
Thanks for the tutorial!! One question: is pygame worth it or is it outdated? What about Python Arcade or similar frameworks?
Thanks again!
The latest version of pygame, called 'pygame-ce' for Community Edition is still being updated while the original pygame seems not so much anymore
@@sstfpv8651 Thank you!
@@sstfpv8651 Thank you!
❤ 😍
Isn't Object-Oriented Programming actually Class-Oriented?
What do you think about that?
Classes create objects, so I don't think it really matters 🙂
forgive me the only reason to subscribe this chanel and watching it your smile ,slang and your laugh not your coding
Thanks it was amazing ,love from india
LETS GO!!!
Why do chicken coups only have two doors? Because if they had four doors, we'd have to call them chicken sedans!
Ohh .I wish somebody bothered to explain it to me as from where I could start the journey! Or the sequence it would save me so much time and frustration 😦😔
TH-cam is bombarded with so many videos 😭
The super function is redundant for most of the code.
She left Sublime Text 😢
🎉🎉
I'd like to introduce you to the pygame.sprite.Sprite and .Group classes
❤❤
Yay 😅
Truck and Police will call draw() twice
And function of draw() is not actually "draw", it is "init".
4:30
Composition > Inheritance
😃👍🎉
I love you pretty and very clever girl😍
stuck in work.. practicing OOP in real life.
Making tons of money while the rest of us slack off at home, wearing pajamas and watching TH-cam 😉
@@PythonSimplified got 3 day weekend now so going to get some "happy" coding done in C ☺
Hey Py~Lady!
shout-Out fr~ @MI
i jst watchD yr 'Next Wave' show
(radiant & composed az ever )
'With AI, Are Coding Jobs at Risk? ft. Python Simplified'
i coMentD 2U there 2:
Hiya 'Py Lady'! (Mariya Sha)
How did you know about my French girls....?
pretty girl and you are very clever
Well python is good at functional programming but it sucks at OOP. Too much boilerplate and unnecessarily complex.
I personally find it much more intuitive than C++ and C#... I guess I'm not a big fan of Header files, declaring stuff and figuring out why the code won't compile if the info in .cpp and .h files don't match 🙃
I think the only downside in the Python way, as mentioned by Badger in the live chat, is that Python private members are not really private. Other than that, I'm a happy camper 😀
@@PythonSimplified yeah, you may be right, everyone have their preference, I started my journey with Python and I used to love it, now I'm a Kotlin/Android developer and trust me I would never like to return to python.
Hey, at least it's not Java! 😅😅😅 hahaha
My uncle has been in the Kotlin/Android sphere for years! It's a great choice of career! 😀
@@PythonSimplified well, kotlin is modern Java and it has replaced java in all manners. "Write once, run anywhere." was a slogan for Java but now It's the Kotlin era. Have you heard about Kotlin/Compose Multiplatform?
ma'am number please for studying purpose
The word self is a reference to the instance (object) of a class, not to the class itself. The reserved word for this is class
Thank you so much. That replacing "self" with "vehicle" really cleared a lot of things
That's awesome! Super happy to help! 😀😀😀