The factors of an integer are those numbers that evenly divide into the integer. Given the integer n, create a list of all the factors of n, excluding 1 and n itself. The list should be ordered from smallest to largest. Associate the new list with the variable factors.

factors = []
for i in range(2, n-1):
if n%i == 0:
factors.append(i)
but it is wrong and reminds me:

In some test cases: the value of factors is incorrect
Correct solutions that use 1 almost certainly also uses sort
Test Case n factors Feedback
#1 2 []
The value of factors is incorrect
#2 30 [2, 3, 5, 6, 10, 15]
#3 12 [2, 3, 4, 6]