[Tutor] function argument unpacking

Peter Otten __peter__ at web.de
Thu Dec 8 04:03:05 EST 2016


Palanikumar wrote:

> File "func.py", line 8
>      tuple_vec = {1, 0, 1)
>                          ^
> SyntaxError: invalid syntax

The opening and the closing parenthesis have to match. 
To get a tuple:

tuple_vec = (1, 0, 1)

To get a set (with two values in undefined order, so not a good match for 
your use case):

set_val = {1, 0, 1}





More information about the Tutor mailing list