Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I wanna Working Code and only PYTHON EXPERT Solutions and please do not post anything if you can not dlo it Fully!!! USE PYTHON* 1.

image text in transcribed

I wanna Working Code and only PYTHON EXPERT Solutions and please do not post anything if you can not dlo it Fully!!! USE PYTHON"""*" 1. Create a class called Team. The class should contain the following attributes: ename league city e country e managerName e conference This refers to the international governing body under which the team plays, e.g. UEFA, CAF, ICC East Asia-Pacific, etc. All of these attributes should be required in the init function. Note part of the beauty of Python-because types are dynamic and inferred, none of the code of Player class needs to be changed even though Team is now a class and not a string 2. teams and initialize it with Add a list or other data structure for teams in the module: Team objects appropriate to the players you defined in the previous lab. You will need to add this earlier in the module than the_players definition. Implement a function addTeam () analogous to addPlayer from the previous lab. 3. Change the player objects to use the teams you have just defined rather than the strings from the previous lab. Ensure that you are re-using the teams you have already defined by fetching them from teams rather than redefining them. 4. Create a class called Match. The class should contain the following instance attributes homeTeam e awayTeam e date . homeScores e awayScores of note are homescores and awayScores, which should be Python dict objects containing a map from Player full name (EirstName and lastName) to a tuple (player,score). Note: this is not a clean or efficient way to do this, but using objects as dictionary keys in Python requires them to support specific properties which we won't go over just yet. Extra credit for those who improve this implementation, either by using Player objects as keys, or through some other means. 5. Implement functions def homeScore (self) and awayscore (se1f) which return the sum of the player scores in homeScores and awayScores. Naturally each should return 0 if no one on the team has scored. I wanna Working Code and only PYTHON EXPERT Solutions and please do not post anything if you can not dlo it Fully!!! USE PYTHON"""*" 1. Create a class called Team. The class should contain the following attributes: ename league city e country e managerName e conference This refers to the international governing body under which the team plays, e.g. UEFA, CAF, ICC East Asia-Pacific, etc. All of these attributes should be required in the init function. Note part of the beauty of Python-because types are dynamic and inferred, none of the code of Player class needs to be changed even though Team is now a class and not a string 2. teams and initialize it with Add a list or other data structure for teams in the module: Team objects appropriate to the players you defined in the previous lab. You will need to add this earlier in the module than the_players definition. Implement a function addTeam () analogous to addPlayer from the previous lab. 3. Change the player objects to use the teams you have just defined rather than the strings from the previous lab. Ensure that you are re-using the teams you have already defined by fetching them from teams rather than redefining them. 4. Create a class called Match. The class should contain the following instance attributes homeTeam e awayTeam e date . homeScores e awayScores of note are homescores and awayScores, which should be Python dict objects containing a map from Player full name (EirstName and lastName) to a tuple (player,score). Note: this is not a clean or efficient way to do this, but using objects as dictionary keys in Python requires them to support specific properties which we won't go over just yet. Extra credit for those who improve this implementation, either by using Player objects as keys, or through some other means. 5. Implement functions def homeScore (self) and awayscore (se1f) which return the sum of the player scores in homeScores and awayScores. Naturally each should return 0 if no one on the team has scored

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions