I have a nested dictionary. I want to sort it firstly by points, secondly by wins ( if points are the same) and lastly by alphabet if wins is equal. At the end I must have the result exactly like :

```
    Spain  wins:1 , loses:0 , draws:2 , goal difference:2 , points:5
Iran  wins:1 , loses:1 , draws:1 , goal difference:0 , points:4
Portugal  wins:1 , loses:1 , draws:1 , goal difference:0 , points:4
Morocco  wins:1 , loses:2 , draws:0 , goal difference:-2 , points:3

```

My problem is with the space between wins,loses,...with the scorces. mine is like :wins: 1 but it must be wins:1 without any space.
Here is my code:

```
dic={"Iran":{"wins":1,"loses":1,"draws":1,"goal difference":0,"points":4},{"Spain":{"wins":1,"loses":0,"draws":2,"goal difference":2,"points":5}},{"Portugal":{"wins":1,"loses":1,"draws":1,"goal difference":0,"points":4}},{"Morocco":{"wins":1,"loses":2,"draws":0,"goal difference":-2,"points":3}}}
sort_data=sorted(dic.keys(),key=lambda x:(-dic[x]["points"],dic[x]["wins"]))
for items in sort_data:
    x=dic[items]
    print(items," ",str(x).replace("'", "").replace("{","").replace("}", ""))

```

all is correct except the space in my output which is like:

```
Iran  wins: 1, loses: 1, draws: 1 , goal difference: 0, points: 4
Portugal  wins: 1, loses: 1, draws: 1, goal difference: 0, points: 4
Morocco  wins: 1, loses: 2, draws: 0, goal difference: -2, points: 3

```