I want to find all the divisors of a number and essentially iterate through n. So for example if I called the function divisors(6) it would calculate 6/1, 6/2, 6/3 6/4 6/5 and 6/6, which would then print (6,2), (6,3) (6,6) and (6,1) but also find divisors of everything up to and including n. So it would also find (5,1) (5,5), (4,2),(4,1),(4,4) etc.
This is what I have so far:
def divisors(n) :
for i in range(2,n+1):
return i
return n
How would I accomplish this?