Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I wanna Working Code and only PYTHON EXPERT Solutions and please do not post anything if you can not do it Fully (Part 1 &
I wanna Working Code and only PYTHON EXPERT Solutions and please do not post anything if you can not do it Fully (Part 1 & Part 2)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
USE PYTHON
Part 1
/////////
Part 2
1. The system you're building should, at minimum, know each player, what team he or she plays for, and some sense of his or her scoring. In the code box below, define three list data structures called name_list, team_list, and score_list. Then populate name_list and team_list with five (5) players in whatever sport field you wish your system to support. For example:name_list ["Asamoah Gyan", "Michael Essien", "Didier Drogba", " Emmanuel Adebayor", "Samuel Eto' o"] team list = ["Sunderland", "Chelsea", "Chelsea", "Man City", "Inter"] 2. Consider how you might store the information regarding scoring. For football, you could record total goals scored but that doesn't give you any information about whether the goal was for a club or national team, when it was scored, against whom, etc. Similarly for cricket, you could record total runs scored, or strike rate, but you would be missing much of the important information. For simplicity, assume you want to record some score (goals scored, runs scored wickets taken, saves, etc.) and the date it occurred. You may implement this as you like, using tuples, dictionaries, or lists, as long as you can return the date as a datetime.date and the score value as an int. 3. You now have the data for a very basic sport statistics program. The next step is to create functions that return the data you want when called. Implement the following functions: a. def highest_score - returns the highest score by anyone in the system in a tuple: (player name, team, date of score, score). b. def highest_score for_player ( player returns the highest score by the supplied player in the same tuple as above, or None if the player is not in the system. Hint: You can find the index of an item in a list by using the index() function, e.g ["a","b","c"].index("b"). You will, however, need to catch an exception if the item is not in the list, so it may be more straightforward to iterate. C. def highest_scorer returns the name of the player with the highest scoring sum, i.e. the total of all the goals/runs/etc. stored in the system. d def highest_average_scorer returns the name of the player with the highest average, i.e the total of all the goals/runs/etc divided by the number of matches. e. def add score( player, date, score adds a new score element to the score datastructure. Note that the date must be a datetime object and score must be an int. 1. The system you're building should, at minimum, know each player, what team he or she plays for, and some sense of his or her scoring. In the code box below, define three list data structures called name_list, team_list, and score_list. Then populate name_list and team_list with five (5) players in whatever sport field you wish your system to support. For example:name_list ["Asamoah Gyan", "Michael Essien", "Didier Drogba", " Emmanuel Adebayor", "Samuel Eto' o"] team list = ["Sunderland", "Chelsea", "Chelsea", "Man City", "Inter"] 2. Consider how you might store the information regarding scoring. For football, you could record total goals scored but that doesn't give you any information about whether the goal was for a club or national team, when it was scored, against whom, etc. Similarly for cricket, you could record total runs scored, or strike rate, but you would be missing much of the important information. For simplicity, assume you want to record some score (goals scored, runs scored wickets taken, saves, etc.) and the date it occurred. You may implement this as you like, using tuples, dictionaries, or lists, as long as you can return the date as a datetime.date and the score value as an int. 3. You now have the data for a very basic sport statistics program. The next step is to create functions that return the data you want when called. Implement the following functions: a. def highest_score - returns the highest score by anyone in the system in a tuple: (player name, team, date of score, score). b. def highest_score for_player ( player returns the highest score by the supplied player in the same tuple as above, or None if the player is not in the system. Hint: You can find the index of an item in a list by using the index() function, e.g ["a","b","c"].index("b"). You will, however, need to catch an exception if the item is not in the list, so it may be more straightforward to iterate. C. def highest_scorer returns the name of the player with the highest scoring sum, i.e. the total of all the goals/runs/etc. stored in the system. d def highest_average_scorer returns the name of the player with the highest average, i.e the total of all the goals/runs/etc divided by the number of matches. e. def add score( player, date, score adds a new score element to the score datastructure. Note that the date must be a datetime object and score must be an int
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started