From db5d2fcff3bbd90c7cf593c1577e82f84caac3d9 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Sat, 27 Feb 2021 13:00:53 -0500 Subject: [PATCH] solve 8.10 LAB --- 8/8.10 LAB/main.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 8/8.10 LAB/main.py diff --git a/8/8.10 LAB/main.py b/8/8.10 LAB/main.py new file mode 100644 index 0000000..d32f987 --- /dev/null +++ b/8/8.10 LAB/main.py @@ -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.')