class Person:
def __init__(self,name,age,sex):
self.name=name
self.age=age
self.sex=sex
def personInfo(self):
print("姓名:",self.name,"年龄:",self.age,"性别:",self.sex)
class Student:
def __init__(self,college,Group):
self.college=college
self.Group=Group
def PersonInfo(self):
print("学院:",self.college,"班级:",self.Group)
class sample(Person,Student):
def __init__(self,name,age,sex,college,Group):
Person.__init__(self,name,age,sex)
Student.__init__(self,college,Group)
p=sample('小麦',20,'男','计算机科学',3)
p.personInfo()
p.PersonInfo()