Question: In this assignment, you are going reimplement the factors function in Assignment 3 using Python to find the proper factors of a number using list
In this assignment, you are going reimplement the factors function in Assignment using Python to find the proper factors of a number using list comprehension.
Given a positive integer value a proper factor of is defined to be an integer value i between to exclusively such that is divisible by ; that is the remainder of dividing by is zero Note that although is divisible by both and they are not proper factors of
The function factors has the following signature:
def factorsn:
This function should return a list of unique integer values. The elements in the list are all proper factors of the parameter, and they must all be unique and in ascending order.
Here are some examples:
factors
factors
factors
factors
factors
Note that the output for the last example is an empty list since is a prime number and it has no proper factor.
Download the three files
cscapycscatester.pycscatestdata.py from Canvas and save them in the same folder. The last two files are the tester program and the testing data file, respectively. Do not modify these two files. The first file is the file you will work on Note that you cannot rename this file and you cannot change the name of the function otherwise the tester will not be able to pick up your implementation
The file csca py contains a dummy implementation of the function that always returns an incorrect value. The contents of the file csca py is listed here for your reference:
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
