Skip to content

Instantly share code, notes, and snippets.

@inky
Created November 16, 2009 15:34
Show Gist options
  • Save inky/236067 to your computer and use it in GitHub Desktop.
Save inky/236067 to your computer and use it in GitHub Desktop.
>>> x = '0123456789'
>>> [{} for _ in x]
[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
>>> [{}] * len(x)
[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment