Skip to content

python 判断是否为回文 #10

@lionzhnn

Description

@lionzhnn

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions