Advertisement
pacho_the_python

Untitled

Feb 10th, 2022
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. employees_happiness = list(map(int, input().split(" ")))
  2. factor = int(input())
  3.  
  4. # employees_happiness = list(map(lambda x: x * factor, employees_happiness))
  5.  
  6. employees_happiness = [x * factor for x in employees_happiness]
  7.  
  8. average_happy = sum(employees_happiness) / len(employees_happiness)
  9. happy_list = []
  10.  
  11. for i in employees_happiness:
  12.     if i >= average_happy:
  13.         happy_list.append(i)
  14.  
  15. if len(happy_list) >= len(employees_happiness) / 2:
  16.     print(f"Score: {len(happy_list)}/{len(employees_happiness)}. Employees are happy!")
  17. else:
  18.     print(f"Score: {len(happy_list)}/{len(employees_happiness)}. Employees are not happy!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement