第三章 7-19 逆序的三位数

n = input()
s = list(n)
if s[-1] == '0':
    if s[-2] == '0':
        print(s[0])
    else:
        print(''.join(s[:2][::-1]))
else:
    print(''.join(s[::-1]))
发布了80 篇原创文章 · 获赞 6 · 访问量 7622

猜你喜欢

转载自blog.csdn.net/qq_33749437/article/details/104888016