Advertisement
PowerCell46

Trekking Mania Python

Dec 17th, 2022
746
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. number_of_groups_of_climbers = int(input())
  2.  
  3. all_people = 0
  4. musala_counter = 0
  5. mondblan_counter = 0
  6. kilimanjaro_counter = 0
  7. k2_counter = 0
  8. everest_counter = 0
  9.  
  10. for index in range(0, number_of_groups_of_climbers):
  11.     current_group = int(input())
  12.     all_people += current_group
  13.  
  14.     if current_group <= 5:
  15.         musala_counter += current_group
  16.     elif current_group > 5 and current_group <= 12:
  17.         mondblan_counter += current_group
  18.     elif current_group > 12 and current_group <= 25:
  19.         kilimanjaro_counter += current_group
  20.     elif current_group > 25 and current_group <= 40:
  21.         k2_counter += current_group
  22.     elif current_group > 40:
  23.         everest_counter += current_group
  24.  
  25. one_percent = all_people / 100
  26. musala_counter = musala_counter / one_percent
  27. print(f'{musala_counter:.2f}%')
  28. mondblan_counter = mondblan_counter / one_percent
  29. print(f'{mondblan_counter:.2f}%')
  30. kilimanjaro_counter = kilimanjaro_counter / one_percent
  31. print(f'{kilimanjaro_counter:.2f}%')
  32. k2_counter = k2_counter / one_percent
  33. print(f'{k2_counter:.2f}%')
  34. everest_counter = everest_counter / one_percent
  35. print(f'{everest_counter:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement