Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- name = input()
- games = int(input())
- volleycounter = 0
- tenniscounter =0
- badmin = 0
- volleyscore = 0.0
- tennisscore = 0.0
- badminscore = 0.0
- pointscounter = 0.0
- for i in range(games):
- nameGame = input()
- points = int(input())
- if nameGame == "volleyball":
- volleyscore += points + (0.07 * points)
- volleycounter += 1
- elif nameGame == "tennis":
- tennisscore += points + (0.05 * points)
- tenniscounter +=1
- elif nameGame == "badminton":
- badminscore += points + (0.02 * points)
- badmin += 1
- sum = volleyscore + tennisscore + badminscore
- volleyscore = math.floor(volleyscore / volleycounter)
- tennisscore = math.floor(tennisscore / tenniscounter)
- badminscore = math.floor(badminscore / badmin)
- #winner = bool(volleyscore >= 75 and tennisscore >= 75 and badminscore >= 75)
- if volleyscore >= 75 and tennisscore >= 75 and badminscore >= 75:
- print(f'Congratulations, {name}! You won the cruise games with {math.floor(sum)} points.')
- else:
- print(f"Sorry, {name}, you lost. Your points are only {math.floor(sum)}.")
Advertisement
Add Comment
Please, Sign In to add comment