I\'m having a hard time expressing this in Python.
This is the description of what needs to be done.
swap_cards: (list of int, int) -> NoneType>
Sounds like some index notation is required here:
>>> def swap_cards(L, n):
... if len(L) == n + 1:
... L[n], L[0] = L[0], L[n]
... return L
... L[n], L[n+1] = L[n+1], L[n]
... return L
...
>>> swap_cards([3, 2, 1, 4, 5, 6, 0], 5)
[3, 2, 1, 4, 5, 0, 6]
>>> swap_cards([3, 2, 1, 4, 5, 6, 0], 6)
[0, 2, 1, 4, 5, 6, 3]