Question: Python pls Create a function total_checker that get the dictionary and other dictionary to get total number of each player's price dict1 = { 'Chealsea':
Python pls
Create a function total_checker that get the dictionary and other dictionary to get total number of each player's price
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_value(player_dict, {'Ink':65, 'Ings':60, 'Dele':55, 'Azur':70}):
#This function take dictionary and returns a dictionary
"""
Calculation
Chealsea = (30-20) * 60 + 20 * 55 + 20*70 = 3700
"""
#This function take dictionary and change that dictionary to another dictionary.
output = { 'Chealsea': ({'Ings': 20, 'Dele': 20, 'Azur': 20}, 3700), 'Barca': ({'Ink': 40}, 2600), 'Atlanta': ({'Ings': 20, 'Azur': 80}, 6800), 'Derby': ({'Azur': 40}, 2800) }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
