Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created July 20, 2012 04:32
Show Gist options
  • Save lxneng/3148716 to your computer and use it in GitHub Desktop.
Save lxneng/3148716 to your computer and use it in GitHub Desktop.
in python3, it'll even work for tuple unpacking:
>>> head, *tail = [1, 2, 3, 4]
>>> head
1
>>> tail
[2, 3, 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment