第25423题 判断题
判断给定Python代码能否正确识别输入正整数是否为对称数

下面的Python代码能用于判断输入的正整数是否为对称数。所谓对称数是指从左到右或从右到左读该数,其值相同,如 121或 414等是对称数,而 123不是对称数。( )

n = int(input("请输入正整数:"))
new_number = 0
while n != 0:
    new_number = new_number * 10 + n % 10
    n //= 10

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