• + 0 comments

    For Python:

    class Calculator(AdvancedArithmetic):
        def divisorSum(self, n):
            self.n = n
            self.total = 0
            for i in range(1, n+1):
                if n%i==0:
                    self.total+=i
            return self.total