J
Jocknerd
I have a list called teamlist which contain dictionaries of teams. These
are the fields in my team dictionary:
name, won, lost, tied, pf, pa
To print standings I do the following:
def printStandings(teamlist):
for team in teamlist:
print (team['name'], team['won'], team['lost'], team['tied'],
team['pf'], team['pa'])
My question is how would I go about sorting the output based on team['pf']
for instance?
are the fields in my team dictionary:
name, won, lost, tied, pf, pa
To print standings I do the following:
def printStandings(teamlist):
for team in teamlist:
print (team['name'], team['won'], team['lost'], team['tied'],
team['pf'], team['pa'])
My question is how would I go about sorting the output based on team['pf']
for instance?