ProgrammingProjectList icon indicating copy to clipboard operation
ProgrammingProjectList copied to clipboard

python 判断是否为回文

Open lionzhnn opened this issue 7 years ago • 0 comments

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'

lionzhnn avatar Apr 12 '18 07:04 lionzhnn