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
"""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())
Comments
Leave a comment