I have a code for the Euros that shows the tables and fixtures etc. With the tables, I have them stored in a json file in a set order that doesn't change, like this:
"Table": {
"Italy": {
"Played": 0,
"Won": 0,
"Draw": 0,
"Lost": 0,
"PF": 0,
"PA": 0,
"PD": 0,
"Points": 0
},
"Switzerland": {
"Played": 0,
"Won": 0,
"Draw": 0,
"Lost": 0,
"PF": 0,
"PA": 0,
"PD": 0,
"Points": 0
},
"Turkey": {
"Played": 0,
"Won": 0,
"Draw": 0,
"Lost": 0,
"PF": 0,
"PA": 0,
"PD": 0,
"Points": 0
},
"Wales": {
"Played": 0,
"Won": 0,
"Draw": 0,
"Lost": 0,
"PF": 0,
"PA": 0,
"PD": 0,
"Points": 0
}
}
I want to be able to sort the teams by the amount of points they have, or the points difference if the points are the same. Ive looked at Python: sorting dictionary of dictionaries and other related questions and still not been able to figure out how it is possible, any help please?