Question: Python pls Create a function called my_num. This function takes a dictionary and returns a dictionary dict1 = { 'Chealsea': [('Ings', 30, 40), ('Dele' ,
Python pls
Create a function called my_num. This function takes a dictionary and returns a dictionary
dict1 = { 'Chealsea': [('Ings', 30, 40), ('Dele' , 20, 50), ('Ings',-10, 60), ('Azur', 20, 55)], 'Barca': [('Ings', 20, 40), ('Ings',-10, 45), ('Ink', 40, 30), ('Ings',-10, 35)], 'Atlanta': [('Ings', 20, 10), ('Dele', 10, 50), ('Azur', 80, 80), ('Dele', -10, 55)], 'Derby': [('Azur', 40, 80), ('Azur', 40, 85), ('Azur',-40, 90)] }
def my_num(tera):
#This function take dictionary and change that dictionary to another dictionary.
output = {
'Ings': {'Chealsea': [(30,40), (-10,60)], 'Barca': [(20,40), (-10,45), (-10,35)], 'Atlanta': [(20,10)]},
'Dele': {'Chealsea': [(20,50)], 'Atlanta': [(10,50), (-10, 55)]},
'Azur': {'Chealsea': [(20,55)], 'Atlanta': [(80,80)], 'Derby': [(40,80), (40,85), (-40,90)]},
'Ink': {'Barca': [(40,30)]}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
