Graphcore Interview Question

Reversing a linked list in python