Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You may not use any list functions other than len(), pop(), extend() and append(). List slices ARE allowed using the [:] operator if you want.

You may not use any list functions other than len(), pop(), extend() and append().

List slices ARE allowed using the [:] operator if you want.

An arcade owner asks you for a program to help them out. They want to increase interest in daily high score winners at each of their arcade game machines, so at the end of every day they want and to publish a list of players who have gotten the highest score on that game. They also want to give a prize to the player who has gotten the most high scores on different machines for the day. Your program should give a prize to that player if no one has gotten more than one high score, choose a winner from the winners list randomly. Write a function that takes in a list of scores from an arcade machine:

[[1, 5, 3, 8, 3], [20, 5], [16, 17, 18]]

And a list of players: ["Rahim", "Ayano", "Louisa"]

The first set of scores in the list of scores belongs to the first player in the list of players, the second list of scores to the second player in the list of players, and so on. Your function should sum each players list of scores, and add the player with the highest sum total score to a list of winners for that day.

In the example above, Louisas scores sum to the highest total, so her name should be added to the list of winners for the day. Provide the following functions in

daily_winners.py: add_winner(list_of_scores, list_of_players, list_of_winners) function should return the list of winners that includes the player from the list_of_players with the highest sum total score

give_prize(list_of_winners), returns winner this function should analyze the list of winners and print out a message for the person whose name appears most often. If there are ties, the winner should be chosen randomly from among those who are tied for the most appearances. The winner's name should also be returned as a string.

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

Step: 3

blur-text-image

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

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago