Question: below _ pay _ average Define a function named below _ pay _ average with one parameter of type list [ Employee ] ( Employee
belowpayaverage
Define a function named belowpayaverage with one parameter of type listEmployeeEmployee is defined in the provided data.py file This function must return a list of type Liststr of the names of employees that are being paid less than the average pay of all employees in the list. The implementation of this function will require computing the average employee pay rate. Your function should work properly when the input list is empty. This function might be used to identify those employees whose pay may be artificially lower than their coworkers.# Abbreviated representation of an employee.
class Employee:
# Initialize a new Employee object.
# input: the employee's name as a string
# input: the employee's pay rate as an integer for simplicity
def self name: str payrate: int:
self.name name
self.payrate payrate
# Provide a developerfriendly string representation of the object.
# input: Employee for which a string representation is desired.
# output: string representation
def repr self:
return "Employeeformatargs:
self.name, self.payrate
# Compare the Employee object with another value to determine equality
# input: Employee against which to compare
# input: Another value to compare to the Employee
# output: boolean indicating equality
def eq self other:
return other is self or
typeother Employee and
self.name other. name and
self.payrate other.payrate
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
