solve 8.10 LAB
This commit is contained in:
parent
f8530d6f43
commit
db5d2fcff3
|
@ -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.')
|
Loading…
Reference in New Issue