<qiyuangong>234_Palindrome_Linked_List_1.py
def isPalindrome( head):
    if head is None:
        return True
    p1, p2 = head, head
    p3, pre = p1.next, p1
    while p2.next is not None and p2.next.next is not None:
        p2 = p2.next.next
        pre = p1
        p1 = p3
        p3 = p3.next
        p1.next = pre
    if p2.next is None:
        p1 = p1.next
    
    while p3 is not None:
        if p1.val != p3.val:
            return False
        p1 = p1.next
        p3 = p3.next
    return True
def sample_funcname ( var_0 ) :
    if var_0 is None :
        return True
    var_3 , var_4 = var_0 , var_0
    var_6 , var_7 = var_3.next , var_3
    while var_4.next is not None and var_4.next.next is not None :
        var_4 = var_4.next.next
        var_7 = var_3
        var_3 = var_6
        var_6 = var_6.next
        var_3.next = var_7
    if var_4.next is None :
        var_3 = var_3.next
    while var_6 is not None :
        if var_3.val != var_6.val :
            return False
        var_3 = var_3.next
        var_6 = var_6.next
    return True
