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 Combo

Mint Milano
Mint Milano
3,114 Points

can anyone please explain me the question in detail..? i did not understand any thing..

how to proceed the problems containing list of tuples etc...

zippy.py
# combo([1, 2, 3], 'abc')
# Output:
# [(1, 'a'), (2, 'b'), (3, 'c')]
# If you use .append(), you'll want to pass it a tuple of new values.
def combo(itr1,itr2):

2 Answers

Steven Parker
Steven Parker
231,269 Points

You may want to start by creating a loop.

Remember the challenge said you could "Assume the iterables will be the same length." So the length of either one would be a good limit for the loop.

Then, inside the loop, you could create a tuple by indexing the iterables with your loop variable and append that tuple to a new list.

Finally, you could return the new list.

Mint Milano
Mint Milano
3,114 Points

[solved] thanks for helping me.