Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- total_count = int(input())
- count_Hearthstone = 0
- count_Fornite = 0
- count_Overwatch = 0
- count_others = 0
- for n in range(0, total_count + 1):
- name_game = str(input())
- if name_game == "Hearthstone":
- count_Hearthstone += 1
- elif name_game == "Fornite":
- count_Fornite += 1
- elif name_game == "Overwatch":
- count_Overwatch += 1
- else:
- count_others += 1
- percent_Hearthstone = (count_Hearthstone / total_count) * 100
- percent_Fornite = (count_Fornite / total_count) * 100
- percent_Overwatch = (count_Overwatch / total_count) * 100
- percent_others = 100 - (percent_Hearthstone + percent_Fornite + percent_Overwatch)
- print(f"Hearthstone - {percent_Hearthstone:.2f}%")
- print(f"Fornite - {percent_Fornite:.2f}%")
- print(f"Overwatch - {percent_Overwatch:.2f}%")
- print(f"Others - {percent_others:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement