Question: Python : most work for any case not just test cases Function name: football_stars Parameters: Two dictionaries, one with strings of states as keys and

Python : most work for any case not just test cases
 Python : most work for any case not just test cases

Function name: football_stars Parameters: Two dictionaries, one with strings of states as keys and lists of NFL team name strings as values, and the other with strings of NFL teams as keys and strings of a top-performing player as values. You can assume valid arguments will be passed into the function every time. Returns: A dictionary with a string of a superstar as the keys paired to a tuple of the state and the team name, respectively, as the values Description: As the football season is in full swing, you feel the urge to create a function to record the state and the team that a top-performing player is on. Write a function that takes in two different dictionaries, one with a state name as the key and a list of teams in that state as the value. The other dictionary has an NFL team name as the key and the name of a top player on that team as the value. If a player in the latter dictionary is on a team that appears in the first list, add the player's name as a key in a new dictionary and match it to a tuple of the state and the team name that the player is on. Test cases: locations "Arizona" ["Cardinals"], "New York" ["Giants", "Jets", "Bills"], "Ohio" ["Bengals", "Browns"]) >>> teams f"Giants: "OBJ" "Cardinals "David Johnson" >>> stars1 football_stars (locations, teams) >>> print (stars1) 'David Johnson': ('Arizona', 'Cardinals Giants)) OB3 'New York' >>locations ("Hawaii": [], "Florida": ["Jags", "Dophins", "Bucs"]) >>> teams = {"Bucs": "FitzMagic", "Jags": "Leonard Fournette") >>> stars2 football_stars(locations, teams) >>> print (stars2) ('Leonard Fournette: (Florida', 'Jags 'FitzMagic': ('Florida, Bucs'))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!