Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started