Q:

Reversing a Linked Node Python

I'm having trouble trying to reverse a linked node in Python. I've been looking at several solutions online, but they've hurt my head as I've tried mapping them on paper. 
How exactly does one reverse a linked node?

A:

Check out this C++ solution perhaps? Essentially, you iterate through the list, and change the next pointer of the node you're considering to the previous node.
[ NULL ] [ 1 ]-> [ 2 ]-> [ 3 ]-> [ NULL ]
           ^ (Start here, the list head, and change the next to the previous (NULL))
[ NULL ] <-[ 1 ] [ 2 ]-> [ 3 ]-> [ NULL ]
                   ^ (Change the next point to the previous)
[ NULL ] <-[ 1 ] <-[ 2 ] [ 3 ]-> [ NULL ]
                           ^ (Change the next point to the previous)
[ NULL ] <-[ 1 ] <-[ 2 ] <-[ 3 ] [ NULL ]
                             ^ (Here's the new list head)

