0
What is a simple example of Class?
3 Answers
+ 1
class A(object):
def f():
print 'foo'
a =A()
a.f()
0
If you mean really an example which you could google it.
BTW
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
0
Class: Pokemon()
Object: Pikachu
âPikachu.thundershock("team rocket meowth")