In class LinkedList, method swap_nodes(self, key_1, key_2), can’t we simply swap the values once we find the nodes containing the keys? For example, we can simply do
curr_1.data = key_2
curr_2.data = key_1
and not mess with the prev and .next assignments etc?
The results are the same using the test cases included.