Inverti una lista concatenata.
def reverse(head):
    prev = None
    cur = head 

    while cur:
        next = cur.next
        cur.next = prev 
        prev = cur 
        cur = next
    head = prev
    
    return head

Traduci il seguente testo in italiano: 'def reverse (head):
    prev = None
    cur = head

    while cur:
        next = cur.next
        cur.next = prev
        prev = cur
        cur = next
    head = prev

    return head'