用python写:判断一个字符串是否是对称字符串例如:abc不是对称字符串aba、abba、aaa、mnanm是对称字符串。是的话输出Yes否则输出No。注意:使用循环和判断语句实现
s = input() l = len(s) for i in range(l//2): if s[i] != s[l-i-1]: print("No") break else: print("Yes")
原文地址: https://www.cveoy.top/t/topic/efBl 著作权归作者所有。请勿转载和采集!