SHARE
TWEET

Untitled

a guest Feb 29th, 2020 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from math import  floor
  2. player_name = input()
  3. number_games = int(input())
  4. points_increase = 0
  5. points_volleyball = 0
  6. points_tennis = 0
  7. points_badminton = 0
  8. points_counter = 0
  9. volleyball_games_counter = 0
  10. tennis_games_counter = 0
  11. badminton_games_counter = 0
  12. points_volleyball_counter = 0
  13. points_tennis_counter = 0
  14. points_badminton_counter = 0
  15. for _ in range(1, number_games + 1):
  16.     game_name = input()
  17.     points_number = int(input())
  18.     if game_name == "volleyball":
  19.         volleyball_games_counter += 1
  20.         points_increase = points_number * 0.07
  21.         points_volleyball = points_number + points_increase
  22.         points_volleyball_counter += points_volleyball
  23.         points_counter += points_volleyball
  24.     elif game_name == "tennis":
  25.         tennis_games_counter += 1
  26.         points_increase = points_number * 0.05
  27.         points_tennis = points_number + points_increase
  28.         points_tennis_counter += points_tennis
  29.         points_counter += points_tennis
  30.     elif game_name == "badminton":
  31.         badminton_games_counter += 1
  32.         points_increase = points_number * 0.02
  33.         points_badminton = points_number + points_increase
  34.         points_badminton_counter += points_badminton
  35.         points_counter += points_badminton
  36.  
  37. volleyball_points_average = points_volleyball_counter / volleyball_games_counter
  38. tennis_points_average = points_tennis_counter / tennis_games_counter
  39. badminton_games_average = points_badminton_counter / badminton_games_counter
  40. if volleyball_points_average > 75 and tennis_points_average > 75 and badminton_games_average >75:
  41.     print(f"Congratulations, {player_name}! You won the cruise games with {floor(points_counter)} points.")
  42. else:
  43.     print(f"Sorry, {player_name}, you lost. Your points are only {floor(points_counter)}.")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top