Last active
May 14, 2019 02:13
-
-
Save hashlash/250889f8994200ba1d4dae30430da5e4 to your computer and use it in GitHub Desktop.
Simple example for using asterisks for unpacking variables (this example is the one without asterisks)
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
# single parameter function | |
# expect kwargs as dict | |
def func3(kwargs): | |
print(kwargs) | |
# you can call the function like this | |
func3({'var1':'hello', 'var2':'world', 'var3':'!'}) | |
# but you can't do something like this | |
func3(var1='hello', var2='world', var3='!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment