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={}

10th Sep 2017, 12:54 PM
Southlittle
Southlittle - avatar
2 odpowiedzi
+ 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
10th Sep 2017, 6:44 PM
yuri
0
Merci @ yuri
11th Sep 2017, 12:26 PM
Southlittle
Southlittle - avatar