```
class Solution(object):
def isPalindrome(self, head):
"""
:type head: ListNode
:rtype: bool
"""
prev = None
item = []
if not head:
return True
current = head
while current: # X->node1->node2->node3.......node7->X
item.append(current.val)
nnext = current.next #save node2
current.next = prev #let current node1 point to X
prev = current #let node1 be the next prev
current = nnext #let current be node2 for next loop
for i in item:
if i != prev.val:
return False
prev = prev.next
return True
```

My idea: invert the list first, and compare the reverted list with the val of the list stored in item.