Created
June 21, 2019 20:25
-
-
Save eyaltrabelsi/99a365873c4aad0e39f248815dc8b67a to your computer and use it in GitHub Desktop.
Python-tricks splat operator
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 test(x, y, z): | |
>>> print(x, y, z) | |
>>> res = test(*[10, 20, 30]) | |
10 20 30 | |
>>> res = test(**{'x': 1, 'y': 2, 'z': 3} ) | |
10 20 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
maybe show as part of a function call where it is extremely useful? this are
func(*args,**kwargs)