第40499题 判断题
下面的Python代码能实现判断输入的正整数是否为对称数。所谓对称数是指从左到右和从右到左读该数,其值相同,如121或414等是对称数,而123不是对称数。( )
n = int(input("请输入正整数:"))

old_number = n
new_number = 0
while n != 0:
    new_number = new_number * 10 + n % 10
    n //= 10

if old_number == new_number:
    print("对称数")
else:
    print("非对称数")
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析