You are viewing a single comment's thread. Return to all comments →
If you are looking for a cleaner way to do this look at debishreenayak13's code. Mine works but runs unnecessary tests.
class Calculator(AdvancedArithmetic): def divisorSum(self, n): divisor = [] divisor.append(1) count = 2 while count <= 1000: if n % count == 0: divisor.append(count) count += 1 divisorSum = sum(divisor) return divisorSum
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 →
If you are looking for a cleaner way to do this look at debishreenayak13's code. Mine works but runs unnecessary tests.
Python3