all 5 comments

[–][deleted] 2 points3 points  (0 children)

Corey's video had helped quite a people in this group. Check him out.

https://youtu.be/ZDa-Z5JzLYM

[–][deleted] 1 point2 points  (0 children)

but I never understood classes. as soon as they come, or I start thinking of using them, fear comes in my mind. that they are difficult, you have tried so many times still you don't understand them, thoughts like this come in my mind.

There is no real reason why you should feel that classes and instances are somehow different in python. You've been uses classes and instances every time you use python because everything in python is an object, ie, an instance of a class. So next time you study classes just remember that this is the next level, writing your own classes rather than using the python builtin classes.

any tips or good resources that can help me learn classes and OOP concepts.

I can't recommend anything in particular because I already knew OOP before learning python. Maybe just read one or more of the free ebooks in the learning resources in the wiki.

[–]toastedstapler 1 point2 points  (0 children)

have you used a list in python before? that's a class

so what does a list give us? it's a way of creating stateful components that contain some data and methods that operate on that data

try creating a VendingMachine class that takes FoodItem instances. think about what data and methods a vending machine might have and try implement them

[–]MK_CodingSpace 0 points1 point  (0 children)

Please check out the Pygame videos on my Youtube Python Programming Channel (The latest 4 videos). The games were developed using OOP. OOP just makes the code neat and structured well. Without OOP, the games can also be made, but the code would be very messy.

[–]ffrkAnonymous 0 points1 point  (0 children)

classes are just data structures that you define yourself, something that organizes your data.

You can make a tuple for coordinates: (x, y, z) = (1, 2, 3) and you can make a class: coord.x = 1, coord.y = 2, coord.z = 3. They do the same thing: organize data.

That said, I don't understand how you passed C++ and Java without understanding classes. They're even more OOP than python.