Answer to Question #264909 in Python for SANJAY

Question #264909

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


1
Expert's answer
2021-11-12T05:06:38-0500
#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")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS