ProgrammingProjectList
ProgrammingProjectList copied to clipboard
python 判断是否为回文
print 'kill game by input end' while 1: s=input("input string:") if s== 'end': break; s1=''; index=0; l=len(s); while index<l: s1=s1+s[l-index-1]; index=index+1; if s1==s: print 'the string is a palindrome' else: print 'the string is not a palindrome'