Question

In: Computer Science

Write a Python program to manage league matches. Different teams can participate in a league. A...

Write a Python program to manage league matches. Different teams can participate in a league. A player belongs to a team and a team can play many games in a league. For each team, the league wants to track the name of the team and the number of players in each team. The league also wants to track the number of games the team has played, and the total numbers of points scored across all games played. During each game, a team can score no points or a number of points represented by a whole number. Create a separate module to test the classes created with at-least 5 teams and display the matches played and the respective scores.

1 league

3 teams

5 players

3 game

Solutions

Expert Solution

PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU

class Team:
#constructor which will initialize all required variable
    def __init__(self, team_name, number_of_players, total_match, total_points):
        self.team_name = team_name
        self.number_of_players = number_of_players;
        self.total_match = total_match
        self.total_points = total_points

#this method will display the matches played by teams and their respective scores
    def display_info(self):
        print("Team : {0}\t Matches Played: {1}\t Score: {2}".format(self.team_name, self.total_match, self.total_points))
  
  
#creating 5 teams object
team1 = Team("Milan", 16, 24, 30)
team2 = Team("Manchester", 30, 120, 200)
team3 = Team("Bercilona", 20, 200, 190)
team4 = Team("Rial", 25, 90, 140)
team5 = Team("Uventus", 22, 80, 100)


#displaying all team info
team1.display_info()
team2.display_info()
team3.display_info()
team4.display_info()
team5.display_info()


Related Solutions

NETWORKING: A KEY TO SUCCESSFUL TEAMWORK a. Consider the different teams. How do the teams manage...
NETWORKING: A KEY TO SUCCESSFUL TEAMWORK a. Consider the different teams. How do the teams manage their team boundaries? What are the trade-offs between internal cohesion and external ties within each type of team? Support your discussion with at least two (2) external sources. B. Consider the list of common roles for team members which of these roles do you think you play in your own team or group? Why? need answer in 400 words.please provide references also
Write a program IN PYTHON of the JUPYTER NOOTBOOK Write a Python program that gets a...
Write a program IN PYTHON of the JUPYTER NOOTBOOK Write a Python program that gets a numeric grade (on a scale of 0-100) from the user and convert it to a letter grade based on the following table. A: 90% - 100% B 80% - 89% C 70% - 79% D 60% - 69% F <60% The program should be written so that if the user entered either a non-numeric input or a numeric input out of the 0-100 range,...
Python program. Write a python program that can convert any radix-d (arbitrary base) number to the...
Python program. Write a python program that can convert any radix-d (arbitrary base) number to the equivalent radix-e (another arbitrary base) number. Where e and d are members in [2, 16]. Remember, base 16 needs to be calculated as hexadecimal. So, if radix-d is input as a hexadecimal number, it needs to convert and output to desired base. Conversely, if base 16 is the desired output, then the output needs to show a hexadecimal number. Hints: The easiest approach is...
Program must be in Python Write a program in Python whose inputs are three integers, and...
Program must be in Python Write a program in Python whose inputs are three integers, and whose output is the smallest of the three values. Input is 7 15 3
Calculating Delivery Cost Program in Python write a program in Python that will ask a user...
Calculating Delivery Cost Program in Python write a program in Python that will ask a user to enter the purchase total, the number of the items that need to be delivered and delivery day. Then the system displays the cost of delivery along with the total cost. Purchase total > $150 Yes Number of the items (N) N<=5 N>=6 Delivery day Same Day Next Day Same Day Next Day Delivery charges ($) 8 N * 1.50 N * 2.50 N...
Regarding Python. 1. How would you write a regex that matches the hour of the day...
Regarding Python. 1. How would you write a regex that matches the hour of the day from the extracted line shown below? (The highlighted portion) From [email protected] Sat Jan 5 09:14:16 2008 Question options: ˆFrom .+ [0-9] ˆX-.*: [0-9.]+ [0-9]: ˆFrom .* [0-9][0-9]: ˆFrom .* ('ˆX\S*: ([0-9.]+)', line) A _____________ sign at the end of the regular expression indicates that the string must end with the specified regex pattern. Question options: question (?) caret (^) dollar ($) 0 / 1...
9) This is in Python Code a program that allows the user to manage its expenses...
9) This is in Python Code a program that allows the user to manage its expenses accepting the following commands: - Add <player_name> -> This command adds a new player to the system. Assume there can’t be repeated names. If a name already exists then an error is shown to the user. - Score <player_name> <score> -> This command adds the score to the player with the name player-name. Each score needs to be added individually - Report -> This...
How can the San Diego Padres, one of the weakest teams in the National League from...
How can the San Diego Padres, one of the weakest teams in the National League from a wins-losses perspective, be one of the most profitable?
Can someone do this python program? Write a function that takes a number as a parameter...
Can someone do this python program? Write a function that takes a number as a parameter and then prints out all of the factors for that number.
For Python: In this assignment you are asked to write a Python program to determine the...
For Python: In this assignment you are asked to write a Python program to determine the Academic Standing of a studentbased on their CGPA. The program should do the following: Prompt the user to enter his name. Prompt the user to enter his major. Prompt the user to enter grades for 3 subjects (A, B, C, D, F). Calculate the CGPA of the student. To calculate CGPA use the formula: CGPA = (quality points * credit hours) / credit hours...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT