Computers and Technology
Computers and Technology, 23.03.2021 01:00, Jasten

PYTHON Complete the Team class implementation. For the instance method get_win_percentage(), the formula is:

team_wins / (team_wins + team_losses)

Note: Use floating-point division.

Ex: If the input is:

Ravens

13

3

where Ravens is the team's name, 13 is the number of team wins, and 3 is the number of team losses, the output is:

Congratulations, Team Ravens has a winning average!

If the input is Angels 80 82, the output is:

Team Angels has a losing average.

THIS IS THE BASE GIVEN:

class Team:
def __init__(self):
self. team_name = 'none'
self. team_wins = 0
self. team_losses = 0

# TODO: Define get_win_percentage()

if __name__ == "__main__":

team = Team()

team_name = input()
team_wins = int(input())
team_losses = int(input())

team. team_name = team_name
team. team_wins = team_wins
team. team_losses = team_losses

if team. get_win_percentage() >= 0.5:
print('Congratulations, Team', team. team_name,'has a winning average!')
else:
print('Team', team. team_name, 'has a losing average.')

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:30, camerondillonn
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
image
Computers and Technology, 23.06.2019 09:10, babyskitt
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, natasniebow
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
image
Computers and Technology, 23.06.2019 21:00, shawnnoteman1234
Which task uses a simple parameter?
Answers: 1
Do you know the correct answer?
PYTHON Complete the Team class implementation. For the instance method get_win_percentage(), the fo...

Questions in other subjects:

Konu
Medicine, 30.08.2021 22:20