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 3 using Python to find the proper factors of a number using list comprehension.
Given a positive integer value n, a proper factor of n is defined to be an integer value i between 1 to n(exclusively) such that n is divisible by i; that is, the remainder of dividing n by i is zero (0). Note that although n is divisible by both 1 and n, they are not proper factors of n.
The function factors has the following signature:
def factors(n):
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(2464),176,224,308,352,616,1232]
factors(3288)[2,3,4,6,8,12,24,137,274,411,548,822,1096,1644]
factors(9676)[2,4,41,59,82,118,164,236,2419,4838]
factors(1179)[3,9,131,393]
factors(4639)[]
Note that the output for the last example is an empty list since 4,639 is a prime number and it has no proper factor.
Download the three files "
csc207a4.py","csc207a4_tester.py","csc207a4_testdata.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 "csc207a4. py" contains a dummy implementation of the function that always returns an incorrect value. The contents of the file "csc207a4. py" is listed here for your reference:
In this assignment, you are going reimplement the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!