Question

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.

Homework Answers

Answer #1

1). ANSWER :

GIVENTHAT :

Here is the code for the following question however if you feel any doubt please feel free to ask.

Code:

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()

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a Java program segment (not an entire program) that will summarize the season results for...
Write a Java program segment (not an entire program) that will summarize the season results for 5 players on one of TRU’s basketball teams. Each player played 10 games. Your program segment should ask the user for a player’s name, followed by the points that player scored in each of the 10 games (a total of 11 pieces of input). Your program will then produce the summary line shown below for that player.   Your program should get the data for...
Write a program that allows two players to play a game of tic-tac-toe. Use a twodimensional...
Write a program that allows two players to play a game of tic-tac-toe. Use a twodimensional char array with three rows and three columns as the game board. Each element in the array should be initialized with an asterisk (*). The program should run a loop that: • Displays the contents of the board array. • Allows player 1 to select a location on the board for an X. The program should ask the user to enter the row and...
The International League of Triple-A minor league baseball consists of 14 teams organized into three divisions:...
The International League of Triple-A minor league baseball consists of 14 teams organized into three divisions: North, South, and West. The following data show the average attendance for the 15 teams in the International League. Also shown are the teams’ records; W denotes the number of games won, L denotes the number of games lost, and PCT is the proportion of games played that were won. A test for any difference in the mean attendance for the three divisions has...
The International League of Triple-A minor league baseball consists of 14 teams organized into three divisions:...
The International League of Triple-A minor league baseball consists of 14 teams organized into three divisions: North, South, and West. The following data show the average attendance for the 15 teams in the International League. Also shown are the teams’ records; W denotes the number of games won, L denotes the number of games lost, and PCT is the proportion of games played that were won. A test for any difference in the mean attendance for the three divisions has...
Use python to write the code You’re going to program a simulation of the following game....
Use python to write the code You’re going to program a simulation of the following game. Like many probability games, this one involves an infinite supply of ping-pong balls. No, this game is "not quite beer pong." The balls are numbered 1 through N. There is also a group of N cups, labeled 1 through N, each of which can hold an unlimited number of ping-pong balls (all numbered 1 through N). The game is played in rounds. A round...
Problem 12-09 The Iowa Energy are scheduled to play against the Maine Red Claws in an...
Problem 12-09 The Iowa Energy are scheduled to play against the Maine Red Claws in an upcoming game in the National Basketball Association Developmental League (NBA-DL). Because a player in the NBA-DL is still developing his skills, the number of points he scores in a game can vary dramatically. Assume that each player's point production can be represented as an integer uniform variable with the ranges provided in the table below. Player Iowa Energy Maine Red Claws 1 [5, 20]...
In java create a dice game called sequences also known as straight shooter. Each player in...
In java create a dice game called sequences also known as straight shooter. Each player in turn rolls SIX dice and scores points for any sequence of CONSECUTIVE numbers thrown beginning with 1. In the event of two or more of the same number being rolled only one counts. However, a throw that contains three 1's cancels out player's score and they mst start from 0. A total of scores is kept and the first player to reach 100 points,...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
I've posted this question like 3 times now and I can't seem to find someone that...
I've posted this question like 3 times now and I can't seem to find someone that is able to answer it. Please can someone help me code this? Thank you!! Programming Project #4 – Programmer Jones and the Temple of Gloom Part 1 The stack data structure plays a pivotal role in the design of computer games. Any algorithm that requires the user to retrace their steps is a perfect candidate for using a stack. In this simple game you...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...