pogend
pogend
发布于 11个月前

Python 检查字符串是否是回文

my_string = "abcba"
if my_string == my_string[::-1]:
    print("palindrome")
else:
    print("not palindrome")
# Output
# palindrome
©2020 edoou.com   京ICP备16001874号-3