Apr-29-2020, 10:03 AM
I've noticed - sometimes there is code like this:
and sometimes code like this:
what is the difference, when each of the variation is being used ?
class Person: def __init__(self, name, age): self.name = name self.age = age p1 = Person("John", 36) print(p1.name) print(p1.age)where class definition is left empty (class Person),
and sometimes code like this:
class Employee(object):where the class is given an arguement,
what is the difference, when each of the variation is being used ?