Discuss / Python / 弟弟来了

弟弟来了

Topic source

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


  • 1

Reply