when you define the class class in Python, you can add ():
class Employee():
"""Employee__doc__"""
empCount = 0
__name1 = "safety"
def __init__(self,name,salary):
self.name = name
self.salary = salary
Employee.empCount += 1
def display_count(self):
print("Totall employee count:{}".format(Employee.empCount))
def display_employee(self):
print("Name:{}, Salary:{}".format(self.name, self.salary))
or not add ():
class Employee:
"""Employee__doc__"""
empCount = 0
__name1 = "safety"
def __init__(self,name,salary):
self.name = name
self.salary = salary
Employee.empCount += 1
def display_count(self):
print("Totall employee count:{}".format(Employee.empCount))
def display_employee(self):
print("Name:{}, Salary:{}".format(self.name, self.salary))
what I have observed so far is that there is no difference between the two; in fact, is there any difference between them? If there is no difference, which way of writing is correct? What I saw in the "Python basic tutorial" is without parentheses.