I am new to coding and I would like some assistance with how to find the divisors of a number [I would like to add them all together and return the result]. Ive seen some examples in different post, but they used for loops. I only know, and can only use, while loops.
anything helps.
asked Mar 12, 2017 at 3:44
You can use while loop to find positive divisors of a number in the following way:
def find_divisors[n]:
if n==0:
return []
if n