Apr-05-2017, 09:57 AM
I know it is all up to the programmer,but do most programmer do
like this:
what do you all think?
which is better?
like this:
class test(): def say(message): print (message) test.say('hello')or,like this:
class test(): def __init__(self,message): self.message=message def say(self): print(self.message) newtest=test('hello') newtest.say()i think using constructor is better,because i can instanciate an object to create multiple copy of the object with just one class.
what do you all think?
which is better?