酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

class student: def __init__(self, name, chinese, math, english, physics, chemistry, biology, politics, history, geography): self.name = name self.chinese = chinese self.math = math self.english = english self.physics = physics self.chemistry = chemistry self.biology = biology self.politics = politics self.history = history self.geography = geography self.total_score = chinese + math + english + physics +

chemistry + biology + politics + history + geography def get_average_score(self): total = self.chinese + self.math + self.english + self.physics + self.chemistry + self.biology + self.politics + self.history + self.geography average = total / 9 return average def get_highest_score(self): scores = [self.chinese, self.math, self.english, self.physics, self.chemistry, self.biology, self.politics, self.history, self.geography] return max(scores) def get_lowest_score(self): scores = [self.chinese, self.math, self.english, self.physics, self.chemistry, self.biology, self.politics, self.history, self.geography] return min(scores) [2024-12-01 20:47:57 | AI写代码神器 | 474点数解答]

相关提问