So, I am comfortable with my python as of rn. So I have taken to learn about classes and I cant seem to understand it I have watched a few video videos and raid some documentations online, and a new book I recently picked up "Black Hat Python" it uses classes a fair bit in it but I am struggling as I can't use classes very well. Has anyone got a certain way they would suggest for me to learn about them? Or does someone have a good explanation? I kinda get it but then I don't its weird.
|
Python
Classes and objects |
(Feb 3, 2020 01:51 PM)Sympth Wrote: So, I am comfortable with my python as of rn. So I have taken to learn about classes and I cant seem to understand it I have watched a few video videos and raid some documentations online, and a new book I recently picked up "Black Hat Python" it uses classes a fair bit in it but I am struggling as I can't use classes very well. Has anyone got a certain way they would suggest for me to learn about them? Or does someone have a good explanation? I kinda get it but then I don't its weird. What exactly are you having trouble comprehending about classes? What they're used for? How create them syntactically?
i like python lua js
Checkout this SO answer. It’s a good explain of classes with a super simple example.
https://codereview.stackexchange.com/a/145764
Feb 3, 2020 02:39 PM
(This post was last modified: Feb 3, 2020 02:41 PM by Sympth.)
(Feb 3, 2020 01:55 PM)Riԁdle Wrote: What exactly are you having trouble comprehending about classes? What they're used for? How create them syntactically? Just classes in general like, making one and doing a certain part of code when its called. as well as then giving it like a user's input if that makes sense? aswell as what they could be used for. As of right now I mainly use functions when splitting up my code. (Feb 3, 2020 02:26 PM)SIM-4073027 Wrote: w3s has a pretty good classes guide Thanks, I will take a look at this now! (Feb 3, 2020 01:56 PM)Charger Wrote: Checkout this SO answer. It’s a good explain of classes with a super simple example. Thanks, I will take a look at this now!
If you want a raw way of learning what's Classes and Objects.
Try and learn Java , you will get used to the concept of OOP. Its basically good for code reusing and maintainability purposes. Its useful trust me, if you want to develop a full program. This concept is really important.
Hi, you are not alone, classes are sometimes more abstract thing, but they are really useful. I had same problem as you to understand them. I have small list of stackoverflow questions about classes in python. It helped a lot.
https://stackoverflow.com/questions/4092...-functions https://stackoverflow.com/questions/3664...-in-python https://stackoverflow.com/questions/1820...-functions https://stackoverflow.com/questions/3307...-in-python |
|
|





![[Image: j90qyxk.gif]](https://i.imgur.com/j90qyxk.gif)
