Skip to content

Instantly share code, notes, and snippets.

@omkz
Created August 5, 2012 02:53
Show Gist options
  • Save omkz/3261280 to your computer and use it in GitHub Desktop.
Save omkz/3261280 to your computer and use it in GitHub Desktop.
python class
class Employee:
'Common base class for all employees'
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
omenk = Employee('Kurnia muhamad', 90000)
omenk.displayEmployee()
omenk.displayCount()
print omenk.salary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment