Skip to content

Instantly share code, notes, and snippets.

@pydanny
Created July 11, 2014 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pydanny/36fbdd89a97db5feab26 to your computer and use it in GitHub Desktop.
Save pydanny/36fbdd89a97db5feab26 to your computer and use it in GitHub Desktop.
def swap(a, x, y):
"""Swap two position values in a list"""
a[x],a[y] = a[y], a[x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment