Skip to content

Instantly share code, notes, and snippets.

@myano
Last active December 20, 2015 07:29
Show Gist options
  • Select an option

  • Save myano/6094059 to your computer and use it in GitHub Desktop.

Select an option

Save myano/6094059 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
## source available at: http://git.io/MYVymw
def try_to_change_list_contents(the_list):
print 'got', the_list
the_list.append('four')
print 'changed to', the_list
outer_list = ['one', 'two', 'three']
print 'before, outer_list =', outer_list
try_to_change_list_contents(outer_list)
print 'after, outer_list =', outer_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment