Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gamer = input()
- games = int(input())
- volleyballGames = 0
- volleyballScores = 0.0
- tennisGames = 0
- tennisScores = 0.0
- badmintonGames = 0
- badmintonScores = 0.0
- for i in range(games):
- game = input()
- score = int(input())
- if game == "volleyball":
- volleyballGames += 1
- volleyballScores += score * 1.07
- elif game == "tennis":
- tennisGames += 1
- tennisScores += score * 1.05
- else:
- badmintonGames += 1
- badmintonScores += score * 1.02
- averageVolleyballPoints = int(volleyballScores / volleyballGames)
- averageTennisPoints = int(tennisScores / tennisGames)
- averageBadmintonPoints = int(badmintonScores / badmintonGames)
- totalPoints = int(volleyballScores + tennisScores + badmintonScores)
- if averageVolleyballPoints >= 75 and averageTennisPoints >= 75 and averageBadmintonPoints >= 75:
- print(f"Congratulations, {gamer}! You won the cruise games with {totalPoints} points.")
- else:
- print(f"Sorry, {gamer}, you lost. Your points are only {totalPoints}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement