Write a python program to accept the age of n employees and count the number of employees in the following ranges: (i) 26 – 35 (ii) 36 – 45 (iii) 46 – 55 also display the employees count who do not fall into any range
Answers
Answered by
0
Answer:
n = int(input("Enter the number of employees: "))
g1 = g2 = g3 = 0
for i in range(1, n + 1) :
age = int(input("Employee's age: "))
if 26 <= age <= 35 :
g1 += 1
elif 36 <= age <= 45 :
g2 += 1
elif 46 <= age <= 55 :
g3 += 1
print("Employees in age group 26 - 35: ", g1)
print("Employees in age group 36 - 45: ", g2)
print("Employees in age group 46 - 55: ", g3)
Similar questions