第12378题 程序题
补全查找500以内完全数的Python代码

完全数 数学中,若一个正整数等于除它自身之外其他所有除数之和,则称该数为完全数。 例如:6除自身外的除数有1、2、3,且1+2+3=6,因此6是完全数。请根据完全数的定义,补全下面找出500以内完全数的Python空缺代码:

for i in range(1,500):
    str1=[]
    for j in    ①    :
        if i%j==0:
              ②
        if   ③    :
            print(f'{i}是完全数')
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
编辑模式
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析