Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write winner function using python and using the score function 17 Dictionaries Function name: winner Parameters: a_dict (dict) Return Type: str Description: This function should

write winner function using python and using the score function image text in transcribed
image text in transcribed
17 Dictionaries Function name: winner Parameters: a_dict (dict) Return Type: str Description: This function should return the name of the winning football team when a_dict has the following format... { "Teaml" : (1, 1, 0, 0, 0), "Team2" : (1, 1, 0, 1, 0)). You may assume that there are only two teams and that there will not be a tie, i.e. both scores will never be the same. Hint: It may be helpful to call the score function you wrote previously. Test Case: >>> a_dict - { "Texans" : (2, 0, 2, 2, 0), "Bills" : (1, 1, 0, 4, 0) >>> winner (a_dict) "Texans" def score(a_tuple): total score - Ca_tuple[0] . 6) + (a_tuple[1]) + (a_tuple[2] . 2) + (o_tuple[3] . 3) + (a_tuple[4] . 2) return total_score

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions