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 trialAngelus Miculek
6,293 Pointsthis didn't work, sadly
I tried to do this:
def show_list():
list_items = ", ".join(shopping_list.copy)
print('Shopping List: {}'.format(list_items))
before seeing the solution, which was this:
def show_list():
print("Here's your list:")
for item in shopping_list:
print(item)
,but my solution created a type error. What happened?
2 Answers
Steven Parker
231,265 PointsTo call a method, you need to put parentheses (with optional arguments) after the method name. Without them you're referring to the method itself instead of the results of calling it.
list_items = ", ".join(shopping_list.copy())
# ^^ add these
Angelus Miculek
6,293 Pointsah! A syntax error -- I should know better. Thanks, Steven.