Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Created June 21, 2019 20:25
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 eyaltrabelsi/99a365873c4aad0e39f248815dc8b67a to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/99a365873c4aad0e39f248815dc8b67a to your computer and use it in GitHub Desktop.
Python-tricks splat operator
>>> 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
@danield137
Copy link

maybe show as part of a function call where it is extremely useful? this are func(*args,**kwargs)

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