Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Classes and objects

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.
(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
w3s has a pretty good classes guide

https://www.w3schools.com/Python/python_classes.asp
(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

https://www.w3schools.com/Python/python_classes.asp

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.

https://codereview.stackexchange.com/a/145764

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.
[Image: j90qyxk.gif]
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


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by PsychoJul 3, 2021 11:15 PM 24 1,973 Jul 3, 2021 11:15 PM
Last Post: Lookdadon
[Python] by Bora or HyunaFeb 14, 2020 12:49 AM 2 310 Feb 14, 2020 12:49 AM
Last Post: Bora or Hyuna
[Python] by pkdarnDec 5, 2019 12:00 AM 16 370 Dec 5, 2019 12:00 AM
Last Post: Money-