0
What's the differences between the way class was created?
class gameobject: class_name="" desc="" objects={} class gameobject: def.__init__(self,class_na me="",desc="",objects={}) self.class_name=class_name self.desc=desc self.objects={}
2 ответов
+ 1
the first one is kind of static. you cannot initiate it with different parameters. the second one provide you with flexibility to have different objects of the same class. (class is a template, object is a instance of the class).
https://code.sololearn.com/cfh7cPpFdgBi/?ref=app
0
Merci @
yuri