class Student:
def __init__(self,name,age,language_score,math_score,english_score):
self.name=name
self.age=age
self.language_score=language_score
self.math_score=math_score
self.english_score=english_score
def get_name(self):
print(self.name)
def get_max_course(self):
max_course=int(self.language_score)+int(self.math_score)+int(self.english_score)
print(max_course/3)
p1=Student('xiaowang',18,50,50,50)
p1.get_name()
p1.get_max_course()
网友评论