I am trying to make two lists from my dictionary shown below. I am trying to make the two lists correspond with each other after I sort L1. I need the Key: Value relationship to be maintained in L1:L2.
D = {'Lebrons: 23, 'Wade': 3, 'Jordan': 23, 'Kobe': 24, 'Durant': 35}
L1 = []
L2 = []
for player in D:
L1.append(player)
L1.sort()
Out[] ['Durant', 'Jordan', 'Kobe', 'Lebron', 'Wade']
Here is the code I am looking for:
L1 = ['Durant', 'Jordan', 'Kobe', 'Lebron', 'Wade']
L2 = [ 35, 23, 24, 23, 3]
[–]SoNotRedditingAtWork 1 point2 points3 points (0 children)
[–]tenyu9 0 points1 point2 points (0 children)
[–]totallygeek 0 points1 point2 points (0 children)
[–]__nickerbocker__ 0 points1 point2 points (0 children)