def reverseList(self, head): r = None while head: head, head.next, r = head.next, r, head
Here is my result:
Runtime Error Message: Line 17: AttributeError: 'NoneType' object has no attribute 'next'
Last executed input: 
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.