We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
basically u just need to make a fucntion to check if a n is divisible by a number from 1 to 1000 or not, and summ all the numbers that are divisors of n.
class Calculator(AdvancedArithmetic):
def divisorSum(self, n):
p=0
e=0
for i in range(1,1001):
e=(n%i)
if e==0:
p+=i
return p
pass
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
basically u just need to make a fucntion to check if a n is divisible by a number from 1 to 1000 or not, and summ all the numbers that are divisors of n.