Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- number_of_games = int(input())
- hearthstone_sales = 0
- fornite_sales = 0
- overwatch_sales = 0
- others_sales = 0
- for each_game in range(number_of_games):
- game_name = input()
- if game_name == 'Hearthstone':
- hearthstone_sales += 1
- elif game_name == 'Fornite':
- fornite_sales += 1
- elif game_name == 'Overwatch':
- overwatch_sales += 1
- else:
- others_sales += 1
- print(f"Hearthstone - {(hearthstone_sales / number_of_games * 100):.2f}%")
- print(f"Fornite - {(fornite_sales / number_of_games * 100):.2f}%")
- print(f"Overwatch - {(overwatch_sales / number_of_games * 100):.2f}%")
- print(f"Others - {(others_sales / number_of_games * 100):.2f}%")
Add Comment
Please, Sign In to add comment