Skip to content

Instantly share code, notes, and snippets.

@wraithan
Created December 16, 2011 00:10
Show Gist options
  • Select an option

  • Save wraithan/1483645 to your computer and use it in GitHub Desktop.

Select an option

Save wraithan/1483645 to your computer and use it in GitHub Desktop.
>>>> a = [[1]] * 10
>>>> a
[[1], [1], [1], [1], [1], [1], [1], [1], [1], [1]]
>>>> a[0][0] = 20
>>>> a
[[20], [20], [20], [20], [20], [20], [20], [20], [20], [20]]
>>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment