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 . (

Comment on Disqus:

Comment on Twitter:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅