Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I wanna python Expert Solutions Use Python Create a class called Team. The class should contain the following attributes name . league . city *

I wanna python Expert Solutions

Use Python

image text in transcribed

image text in transcribed

Create a class called Team. The class should contain the following attributes name . league . city * country managerName . 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 Add a list or other data structure for teams in the module: teams and initialize it with 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 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. Create a class called Match. The class should contain the following instance attributes homeTeam awayTeam date homeScores awayScores of note are homeScores and awayScores, which should be Python dict objects containing a map from Player full name (firstName 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 Create a class called Team. The class should contain the following attributes name . league . city * country managerName . 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 Add a list or other data structure for teams in the module: teams and initialize it with 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 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. Create a class called Match. The class should contain the following instance attributes homeTeam awayTeam date homeScores awayScores of note are homeScores and awayScores, which should be Python dict objects containing a map from Player full name (firstName 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

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago

Question

3. Identify challenges to good listening and their remedies

Answered: 1 week ago

Question

4. Identify ethical factors in the listening process

Answered: 1 week ago