im a rookie, but I tired this and it works lol:
def swap(alist): first = alist[0] last = alist[-1] alist[0] = last alist[-1] = first return alist