Advertisement
BbJLeB

05. Fitness Center

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