subject
Engineering, 22.03.2021 19:10 fatherbamboo

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: 2

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, settasav9641
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
image
Engineering, 04.07.2019 18:10, 19deleonl
Coiled springs ought to be very strong and stiff. si3n4 is a strong, stiff material. would you select this material for a spring? explain.
Answers: 2
image
Engineering, 04.07.2019 18:10, johnthienann58
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
image
Engineering, 04.07.2019 18:10, juansoto227711
Journeyman training is usually related (clo2) a)-to specific tasks b)-to cost analysis of maintenance task c)-to control process to ensure quality d)-to installation of machinery
Answers: 2
You know the right answer?
PYTHON Complete the Team class implementation. For the instance method get_win_percentage(), the fo...

Questions in other subjects:

Konu
English, 10.07.2019 15:00