学习时间:
2023年1月27日
题目描述:

题解分享:
# 作者: 繁华倾夏
# 力扣(LeetCode):9. 回文数
class Solution:
# def isPalindrome(self, x: int) -> bool: # 力扣测试时调用
def isPalindrome(x):
return str(x)==str(x)[::-1] # 利用切片逆序输出
# 测试用例-python编程时需严格注意缩进,否则程序不能正常运行
# 输入 x = 121
# 输出 true
if __name__ == '__main__':
x=121;
re= isPalindrome(x)
print(re);

534

被折叠的 条评论
为什么被折叠?



