Def sum_divisors (n) : sum = 1 # Return the sum of all divisors of n, not including n x=int (n**0.5) for i in range (2, (x//1) + 1) : if n%i==0: sum=sum+i if n%i==0 and n/i!=i: sum=sum + (n/i) return sum print (sum_divisors (0)) # 0 print (sum_divisors (3)) # Should sum of 1 # 1 print (sum_divisors (36)) # Should sum of 1+2+3+4+6+9+12+18 # 55 print (sum_divisors (102)) # Should be sum of 2+3+6+17+34+51 # 114
+5
Answers (1)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Def sum_divisors (n) : sum = 1 # Return the sum of all divisors of n, not including n x=int (n**0.5) for i in range (2, (x//1) + 1) : if ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Home » Computers and Technology » Def sum_divisors (n) : sum = 1 # Return the sum of all divisors of n, not including n x=int (n**0.5) for i in range (2, (x//1) + 1) : if n%i==0: sum=sum+i if n%i==0 and n/i!