Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Matthew Byrne
1,920 PointsCombo
When I run this code in Workspaces it gives me back separate lists each containing a tuple. am I at least on the right track? Any help would be great, thanks.
def combo(iterable1, iterable2):
index = 0
while index < len(iterable1) and index < len(iterable2):
letter1 = iterable1[index]
letter2 = iterable2[index]
index = index + 1
tup = (letter1, letter2)
my_list = []
my_list.append(tup)
return my_list
2 Answers

Oszkár Fehér
Treehouse Project ReviewerHi Matthew, Actually the code contains everything to pass the challenge just one indentation and a variable definition
def combo(iterable1, iterable2):
index = 0
while index < len(iterable1) and index < len(iterable2):
letter1 = iterable1[index]
letter2 = iterable2[index]
index = index + 1 <<---here
tup = (letter1, letter2)
my_list = [] <<--- this variable it should be defined outside of while loop
my_list.append(tup)
return my_list <<--- the indentation, it should be in the same column with the while loop, outside of the loop
def combo(iterable1, iterable2):
index = 0
my_list = []
while index < len(iterable1) and index < len(iterable2):
letter1 = iterable1[index]
letter2 = iterable2[index]
index += 1
tup = (letter1, letter2)
my_list.append(tup)
return my_list
Keep up the good work. Happy coding

Matthew Byrne
1,920 PointsThanks Oszkár, that helps a lot :)