Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 5. Wedding Presents
- guests = int(input())
- gift = int(input())
- all_gifts = 0
- money_gifts = 0 # A
- elec_gifts = 0 # B
- vaucher_gifts = 0 # V
- other_gifts = 0 # G
- for i in range (gift):
- meme = input()
- if meme == "A":
- money_gifts += 1
- elif meme == "B":
- elec_gifts += 1
- elif meme == "V":
- vaucher_gifts += 1
- elif meme == "G":
- other_gifts += 1
- procent_money = (money_gifts / gift) * 100
- procent_elec = (elec_gifts / gift) * 100
- procent_vaucher = (vaucher_gifts / gift) * 100
- procent_other = (other_gifts / gift) * 100
- average_gift = (gift / guests) * 100
- print(f"{procent_money:.2f}%")
- print(f"{procent_elec:.2f}%")
- print(f"{procent_vaucher:.2f}%")
- print(f"{procent_other:.2f}%")
- print(f"{average_gift:.2f}%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement