class Human:
def __init__(self,name ):
self.name = name
def sayHello(self, something):
print(self.name, "Hey,", something)
def singing(self, song):
print(self.name, "sing a song:",song)
h1 = Human("赵云")
h1.sayHello('today is fine!')
h1.singing('finger')
class Student(Human):
def study(self,object):
print(self.name,"study ", object)
stu = Student("郭嘉")
stu.sayHello("Hi, master Cao, I'm comming")
stu.singing("national song")
stu.study("Python")
class cook(Human):
def cook_dish(self,dish):
print(self.name,"cook a disk named:",dish)
llj = cook("lulijuan")
llj.sayHello("darling wang")
llj.singing("I LOVE U")
llj.cook_dish("chicken")