def is_palindrome(n):
front=0
rear=len(str(n))-1
while rear>front:
if str(n)[front]==str(n)[rear]:
front=front+1
rear=rear-1
else:
return False
return True
❤
Sign in to make a reply
用户6059415853
def is_palindrome(n):
front=0
rear=len(str(n))-1
while rear>front:
if str(n)[front]==str(n)[rear]:
front=front+1
rear=rear-1
else:
return False
return True