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, 04.07.2019 18:10
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
Different types of steels contain different elements that alter the characteristics of the steel. for each of the following elements, explain what the element does when alloyed with steel.
Answers: 2
question
Engineering, 04.07.2019 18:20
Derive the correction factor formula for conical nozzle i=-(1+ cosa) and calculate the nozzle angle correction factor for a nozzle whose divergence hal-fangle is 13 (hint: assume that all the mass flow originates at the apex of the cone.
Answers: 3
question
Engineering, 04.07.2019 18:20
Atank with constant volume contains 2.27 kg of a mixture of water phases (liquid-vapor). in the initial state the temperature and the quality are 127 °c and 0.6, respectively. the mixture is heated until the temperature of 160 oc is reached. illustrate the process in a t-v diagram. then, determine (1) the mass of the vapor in kg at the initial state, (2) the final pressure in kpa.
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, 13.05.2021 17:30
question
Chemistry, 13.05.2021 17:30
Questions on the website: 13722363