Sichanov

ss

Apr 23rd, 2021 (edited)
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. number_of_games = int(input())
  2. hearthstone_sales = 0
  3. fornite_sales = 0
  4. overwatch_sales = 0
  5. others_sales = 0
  6. for each_game in range(number_of_games):
  7.     game_name = input()
  8.     if game_name == 'Hearthstone':
  9.         hearthstone_sales += 1
  10.     elif game_name == 'Fornite':
  11.         fornite_sales += 1
  12.     elif game_name == 'Overwatch':
  13.         overwatch_sales += 1
  14.     else:
  15.         others_sales += 1
  16. print(f"Hearthstone - {(hearthstone_sales / number_of_games * 100):.2f}%")
  17. print(f"Fornite - {(fornite_sales / number_of_games * 100):.2f}%")
  18. print(f"Overwatch - {(overwatch_sales / number_of_games * 100):.2f}%")
  19. print(f"Others - {(others_sales / number_of_games * 100):.2f}%")
Add Comment
Please, Sign In to add comment