y in the given image below. : class Team: def __init__(self): self.team_name = 'none' self.team_wins = 0 self.team_losses = 0 def get_win_percentage(self): return self.team_wins / (self.team_wins + self.team_losses) 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('Win Percentage: ',(team.get_win_percentage())) print('Congratulations, Team', team.team_name, 'has a winning average!') else: print('Team', team.team_name, 'has a losing average.')
I need help fixing a python code that should display in the given image below.
:
class Team:
def __init__(self):
self.team_name = 'none'
self.team_wins = 0
self.team_losses = 0
def get_win_percentage(self):
return self.team_wins / (self.team_wins + self.team_losses)
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('Win Percentage: ',(team.get_win_percentage()))
print('Congratulations, Team', team.team_name, 'has a winning average!')
else:
print('Team', team.team_name, 'has a losing average.')
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images