Code ans = 1 # 加上它本身 # 只需迭代到本身的一半即可 for i in range(1, int(78120 / 2) + 1): if 78120 % i == 0: ans += 1 print(ans) Result 96