def divisors(n):
ans =0
for i in range(n):
i += 1
k=n%i
if k!=1:
ans=i
return ans
print(20)
I have a function that's not working properly when I run it prints the n value instead of printing out the divisors.
print(divisors(20)), but that will only print the lastansvalue sincedivisors()does not return a list.