solve 8.10 LAB

This commit is contained in:
Joe S 2021-02-27 13:00:53 -05:00
parent f8530d6f43
commit db5d2fcff3
1 changed files with 27 additions and 0 deletions

27
8/8.10 LAB/main.py Normal file
View File

@ -0,0 +1,27 @@
class Team:
def __init__(self):
self.team_name = 'none'
self.team_wins = 0
self.team_losses = 0
self.win_percentage = 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('Congratulations, Team', team.team_name,'has a winning average!')
else:
print('Team', team.team_name, 'has a losing average.')