Sum the factors of a number (excluding the number itself)

前端 未结 0 668
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 10:24

After I edited my code, I got the answer:

def sum_factors(n):
  sum = 0
  factor = 1
  # Return the sum of all factors of n, not including n
  while n!=0 and          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题