Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- player = input()
- games_count = int(input())
- total, game1, game2, game3, avr1, avr2, avr3 = 0, 0, 0, 0, 0, 0, 0
- for i in range(1, games_count + 1):
- game_name = input()
- score = int(input())
- if game_name == "volleyball":
- score *= 1.07
- game1 += 1
- avr1 += score
- elif game_name == "tennis":
- score *= 1.05
- game2 += 1
- avr2 += score
- elif game_name == "badminton":
- score *= 1.02
- game3 += 1
- avr3 += score
- total += score
- avr1 /= game1
- avr2 /= game2
- avr3 /= game3
- if avr1 >=75 and avr2 >= 75 and avr3 >= 75:
- print(f"Congratulations, {player}! You won the cruise games with {math.floor(total)} points.")
- else:
- print(f"Sorry, {player}, you lost. Your points are only {math.floor(total)}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement