The manager of company has asked his assistant to present him with
the list the ages of all the workers working in manufacturing division
who are having the experience of 20 years. The assistant of thee
manager replied him with the list of 10 employees who are having the
experience of 20 years. Write a program that store the age of all 15
employees in 1D array and then print the total count of employees
whose age lies between 50 and 60. Use functions to solve this task
PLEASE SOLVE IT USING PYTHON
Input Format ->57 49 54 48 59 55 46 57 58 60 58 62 56 70 73
Constraints-> The Age of the employees should be greater than or equal to 40 and less than or equal to 60. If constraints do not match then show "wrong input"
Output Format - EXAMPLE 8 EMPLOYEES
#Ages = [57, 49, 54, 48, 59, 55, 46, 57, 58, 60, 58, 62, 56, 70, 73]
Ages = input("Enter ages followed by SPACE: ")
Ages = str(Ages).split(" ")
LOWER_AGE = 40
UPPER_AGE = 60
Flag=0
c=0
for r in range(0,len(Ages)):
if(int(Ages[r])>=LOWER_AGE and int(Ages[r])<=UPPER_AGE):
Flag=1
c=c+1
if(Flag):
print("%d EMPLOYEES"%c)
else:
print("Wrong Input")
Comments
Leave a comment