subject
Engineering, 22.03.2021 19:10 naterjax

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.')

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Line joining liquid phase with liquid and solid phase mixture is known as: a) liquidus b) solidus c) tie line d) none of the mentioned
Answers: 2
question
Engineering, 04.07.2019 18:10
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
Answers: 3
You know the right answer?
PYTHON Complete the Team class implementation. For the instance method get_win_percentage(), the fo...
Questions
question
Mathematics, 19.02.2021 01:00
question
Mathematics, 19.02.2021 01:00
Questions on the website: 13722360