8 Respostas
+ 6
Classes are (in layman terms) a group where you can store lots of stuff, e.g. Functions, objects,variable, etc.
Classes exist so that they can group stuff neatly.
Like if I have functions all over the place (especially a lot of them) it looks horribly incomprehensible.
Class-ing them groups them into neat groups.
+ 8
https://code.sololearn.com/WBHiShj1ublU/?ref=app
Check Python resources here
First complete the very basic sololearn course
+ 6
It's Vengat!!!
+ 3
Kevin you must to read simple lesson in Sololearn and of course do examples
+ 2
@daniel, im already read all best source in internet,ebook.
+ 2
it goes like this
class classname:
#initialize
def __init__(self, more parameters)
self.parameter=parameter
def method1(self,parameters)
statement
#you can have as many paramters, methods and as many classes as you want.
#to create an object
Name=classname(parameters, do not fill anything for self.)
#acsess class methods
print(classname.method(method parameters))
#inheriting
class classname2(classname to inherit from)
#no __init__ statement because it was already done in the inhertinca class
def method1(self,parameters):
statements
#you acceses and create objects the same way.
+ 1
@tagnev wow, so many programming ebooks.
0
okay vengat.thnx.i will try looking a right ebook for me from ur code