Skip to content

Instantly share code, notes, and snippets.

@carlcrott
Created December 17, 2014 01:28
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 carlcrott/8788963ad62bbd660263 to your computer and use it in GitHub Desktop.
Save carlcrott/8788963ad62bbd660263 to your computer and use it in GitHub Desktop.
asdf = range(1,20)
for i in range(0, len(asdf)):
print "iter: {0}".format( i )
# break for end of list
if i == ( len(asdf) - 1 ) :
break
asdf[i], asdf[i+1] = asdf[i+1], asdf[i]
print asdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment