Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (Retired) Tuples Two-ples

I have no idea what the answer to this is, was this even talked about it in the Video?

Could anyone explain this question & its answer to me please?

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

The question:

    Dictionaries use what special operator to unpack: 
        for example, when using str.format(________my_dictionary ). 
    Tuples, however, use the alternative string.format(________my_tuple).

refers to using the "**" and "*" to unpack containers. "**" is used to unpack dictionaries into keyword arguments and "*" is used to unpack tuples into positional arguments:

    Dictionaries use what special operator to unpack: 
        for example, when using str.format(**my_dictionary ). 
    Tuples, however, use the alternative string.format(*my_tuple).
jason chan
jason chan
31,009 Points

Hey Jan,

I recommend re-watching the video and reading the transcript for the answer.

https://teamtreehouse.com/library/python-collections/tuples/tuples-with-functions

Yes, which of the four questions do you not know the answer for, we are happy to help?

I dont know how to fill the blanks:

Dictionaries use what special operator to unpack: for example, when using str.format( my_dictionary ). Tuples, however, use the alternative string.format( my_tuple).