【发布时间】:2021-06-23 22:16:41
【问题描述】:
我想写一个方法来找到得分最低的人并打印他的其他详细信息。
如果我写一个方法来找到最小值,我就无法打印他的其他详细信息。 有问题的是,它被告知在另一个名为 Team 的类中编写“getMinRuns”。
python3
class Player:
def __init__(self,playerName,playerCountry,playerScore):
self.playerName=playerName
self.playerCountry=playerCountry
self.playerAge=playerScore
class Team:
def getMinRuns(p):
pass
n=int(input())
p=[]
for i in range(n):
name=input()
country=input()
score=int(input())
p.append(Player(name,country,score))
Team.getMinRuns(p)
【问题讨论】:
标签: python-3.x list object listobject python-object