Swapping pairs in a linked list in Python, one link disappears?
问题 I have been learning about linked lists, and implementing one in python has been easier than I expected. However, when it has come to solving the problem of "swapping pairs in a linked list", for some reason my second link disappears during the swap. I've been staring at this for ages and trying different solutions I found online. They all get the same result which suggests my problem is with the implementation of the list itself. Or I've made a silly error somewhere that I can't see! I would