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 trialPrisca Egbua
1,167 Pointswhat am I doing wrong, please?
I want to return a list of tuples
# combo([1, 2, 3], 'abc')
# Output:
# [(1, 'a'), (2, 'b'), (3, 'c')]
def combo(a_list,some_string):
for a in a_list:
for b in some_string:
print("{},{}".format(a,b))
combo([1,2,3],"abc")
1 Answer
Steven Parker
231,236 PointsYou say you "want to return a list of tuples", but this code isn't returning anything at all, yet!
Additional hints:
- you won't need to "print" anything
- you only need to define the function, you don't need to call it yourself