python unpack tuple code example
Example 1: unpacking tuples in python
>>> def f():
return 1,2
>>> a,b=f()
>>> a
1
>>> b
2
Example 2: python unpack list
function_that_needs_strings(*my_list) # works!
>>> def f():
return 1,2
>>> a,b=f()
>>> a
1
>>> b
2
function_that_needs_strings(*my_list) # works!