Advertisement
Spocoman

Fitness Center

Feb 22nd, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. visitors = int(input())
  2. back = 0
  3. chest = 0
  4. legs = 0
  5. abs = 0
  6. protein_shake = 0
  7. protein_bar = 0
  8.  
  9. for i in range(visitors):
  10.     action = input()
  11.     if action == "Back":
  12.         back += 1
  13.     elif action == "Chest":
  14.         chest += 1
  15.     elif action == "Legs":
  16.         legs += 1
  17.     elif action == "Abs":
  18.         abs += 1
  19.     elif action == "Protein shake":
  20.         protein_shake += 1
  21.     elif action == "Protein bar":
  22.         protein_bar += 1
  23.  
  24. print(f"{back} - back")
  25. print(f"{chest} - chest")
  26. print(f"{legs} - legs")
  27. print(f"{abs} - abs")
  28. print(f"{protein_shake} - protein shake")
  29. print(f"{protein_bar} - protein bar")
  30. print(f"{(back + chest + legs + abs) / visitors * 100:.2f}% - work out")
  31. print(f"{(protein_shake + protein_bar) / visitors * 100:.2f}% - protein")
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement