Created
January 11, 2017 17:36
-
-
Save vy-nguyen/2f0e3e930e3efdef9e5c8e458bdaf565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def func1(x, y, z): | |
print x | |
print y | |
print z | |
def func2(*args): | |
# Convert args tuple to a list so we can modify it | |
args = list(args) | |
args[0] = 'Hello' | |
args[1] = 'awesome' | |
func1(*args) | |
func2('Goodbye', 'cruel', 'world!') | |
# Will print | |
# > Hello | |
# > awesome | |
# > world! | |
This happens simply because we're |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment