-6
class Employee:
empCount=0 def __init__(self, name,salary):
self.name=name
self.salary=salary
Employee.empCount+=1 def displayCount(self):
print "Total Employee %d" %Employee.empCount def displayEmployee(self):
print "Name:",self.name,",salary:",self.salary emp1 = Employee("zara" , 2000) emp2 = Employee("manni" , 3000) emp1.displayEmployee() emp2.displayEmployee()
請修復您的格式。這是不可讀的。然後發佈* full *錯誤消息和追蹤。 –
@ PM2Ring我不認爲'我的編輯並沒有真正改善',我想OP希望使用'Code Sample'而不是'Blockquote',我不想修復縮進問題,我會喜歡讓op的意圖更加明顯,這就是爲什麼我將'Blockquote'更改爲'Code Sample'。 – McGrady