Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could somebody help me with this program, please? Only allowed to use len(), pop(), extend() and append() for list methods. PICK THE WINNER PYTHON PROGRAM

Could somebody help me with this program, please?

Only allowed to use len(), pop(), extend() and append() for list methods.

PICK THE WINNER PYTHON PROGRAM

The setting: Daily Winners

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 running 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.

Sample "give_prize" output (use your creativity, it doesn't need to be exactly this on the print output):

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

ISBN: 0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 401(k) feature?

Answered: 1 week ago