subject
Engineering, 22.03.2021 22:40 mariah8926

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
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 19:20
Acircular pipe of 30mm outside diameter is placed in an airstream at 30 c and latm pressure. the air moves in cross flow over the pipe at 20 m/s, while the outer surface of the pipe is maintained at 110 c. what is the drag force exerted on the pipe per unit length? what is the rate of heat transfer from the pipe per unit length?
Answers: 1
question
Engineering, 05.07.2019 04:30
Technician a says that in a worm gear steering system, most excessive steering free play is usually found in the gearbox. technician b says that in a rack-and-pinion steering system, excessive free play can be found in the bushings. who is correct?
Answers: 2
question
Engineering, 06.07.2019 04:20
Steam in a heating system flows through tubes whose outer radius is 2.5 cm and whose walls are maintained at a temperature of 180 °c . circular aluminum alloy 2024-t6 fins ( k= 186 wm. k) of outer radius 3 cm and constant thickness 1 mm are attached to the tube. the space between the fins is 3 mm and thus there are 250 fins per meter of tube length. heat is transferred to the surrounding air at too-25 °c, with a heat transfer coefficient of 40 w/m2. k. manufacturer a claims that this system is rated at 3.5 kw per meter of tube length. if the fins are an integral part of the steam tube, find the heat transfer rate in kw for a 1-m length of tube. is manufacturer a's claim valid? compare the heat transfer rate from 1 meter of tube length if there are no fins.
Answers: 3
You know the right answer?
PYTHON Complete the Team class implementation. For the instance method get_win_percentage(), the fo...
Questions
Questions on the website: 13722367