Answer to Question #264496 in Python for SANJAY

Question #264496

The manager of the company has informed his assistant to enter the


age of all the workers working in production department. Among all


he has to find the employee with minimum age employee. Help the


manager to find the minimum age employee by storing the all age of


all employees in 1D array. Use functions to solve this task.


Input Format


30 43 27 51 19


Constraints


All the inputs should be greater than 0 otherwise print wrong input


Output Format


19



SOLVE IT USING PYTHON


1
Expert's answer
2021-11-11T17:36:15-0500
"""importing a numpy library, because it is needed to  
   story an array and to do calculations to find min value""" 
import numpy as np 
 
#below, creating an array variable where you can enter your data 
x = np.array([30, 43, 27, 51, 19]) 
 
#creating conditions to define minimum age and wrong input 
if x[x<0]: 
    print("Wrong Input") 
else: 
    print('The minimum age among workers is: ', x.min())

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