Skip to content

Instantly share code, notes, and snippets.

@yupe
Created May 13, 2015 11:55
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 yupe/34486fb3e271d935f49e to your computer and use it in GitHub Desktop.
Save yupe/34486fb3e271d935f49e to your computer and use it in GitHub Desktop.
???
n = [3, 5, 7]
def double_list(x):
n.append('!')
print n
# Don't forget to return your new list!
print double_list(n)
@im-kulikov
Copy link

а что ты хотел, чтобы вернула функция?

@im-kulikov
Copy link

В данном случае, у тебя:

передаётся локальная переменная "x", а работаешь с глобальной "n"

@im-kulikov
Copy link

или не о том речь?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment