Computer Science, asked by krishnakarkera2003, 9 months ago

#please help
import math
def sum_divisors(num) :
result = 0
i = 2

while i<= (math.sqrt(num)) :

if (num % i == 0) :

if (i == (num / i)) :

result = result + i;

else :

result = result + (i + num/i);

i = i + 1


return (result + 1);



print(sum_divisors(0))

# the output should be 0
print(sum_divisors(3)) # Should sum of 1
# the output should be 1
print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18
# the output should be 55
print(sum_divisors(102)) # Should be sum of 2+3+6+17+34+51
# the output should be 114

Answers

Answered by rajkumarmandal2016
0

Explanation:

Gretchen I was going to be at work on me and my phone is a way

Similar questions