Advertisement
DiYane

The office

Sep 20th, 2023
702
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. happiness_str = input()
  2. happiness_values = list(map(int, happiness_str.split()))
  3. improvement_factor = int(input())
  4.  
  5. new_happiness_scores = [h * improvement_factor for h in happiness_values]
  6. average_happiness = sum(new_happiness_scores) / len(new_happiness_scores)
  7.  
  8. happy_count = sum(1 for score in new_happiness_scores if score >= average_happiness)
  9. total_count = len(new_happiness_scores)
  10.  
  11. if happy_count >= total_count / 2:
  12.     print(f"Score: {happy_count}/{total_count}. Employees are happy!")
  13. else:
  14.     print(f"Score: {happy_count}/{total_count}. Employees are not happy!")
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement