Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # list_unpack_with_single_star.py
- # The single star (*) unpacks the sequence/collection into positional arguments, so you can do this...
- def sum(a, b):
- return a + b
- values = (1, 2)
- print sum(*values)
- # This will unpack the tuple so that it actually executes as...
- print sum(3, 6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement