Question #312

What is the output of the code snippet below?
my_tuple = (1, 2, 3)
print(0, 2*my_tuple, 4)

An interesting use-case for the unpacking operator, * , is the ability to merge several iterables into a final sequence. This functionality works for lists, tuples, and sets. Note that we unpack here 2*my_tuple . (stackabuse.com/unpacking-in-python-beyond-parallel-assign...)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵