📌  相关文章
📜  第19天:在python代码示例中接口hackerrank解决方案

📅  最后修改于: 2022-03-11 14:45:11.223000             🧑  作者: Mango

代码示例1
// day 19: interfaces hackerrank solution in python
  class Calculator(AdvancedArithmetic):
    def divisorSum(self, n):
        return divisor(n)
    
    
def divisor(n):
    c = 1
    s = 0
    while c <= n:
        if n % c == 0:
            s += c
        c += 1
    return s