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 trialDavid Biayna Neal
3,871 PointsError message with SHOW command: Error Message: Message=show_list() missing 1 required positional argument: 'item'
Probably will be something simple. I added a few items to the shopping list. I want to display the list and get this following message:
Error Message: Message=show_list() missing 1 required positional argument: 'item'
It tells me the error is in the last elif loop
elif new_item == 'SHOW': show_list() continue
3 Answers
Steven Parker
231,275 PointsThe error message seems to be saying that the "show_list" function was defined to take an argument, but you are calling it without one. Take a look at the definition for the function (around line 17) and see if you have something like this:
def show_list(item):
That would cause an error like this. In the video, the definition has nothing between the parentheses.
David Biayna Neal
3,871 Points#Sorry yes please see full code thank you, i have the function def_show_list(item) defined
def show_list(item):
print("Here is your list: ")
for item in shopping_list:
print(item)
show_help()
while True:
new_item = input("> ")
if new_item == 'DONE':
break
elif new_item == 'HELP':
show_help()
continue
elif new_item == 'SHOW':
#ERROR MESSAGE HIGHLIGHTS THE FOLLOWING LINE
show_list()
continue
add_to_list(new_item)
show_list()
[MOD: added ```python formatting -cf]
David Biayna Neal
3,871 PointsAwesome that worked thanks a million for your help.
Chris Freeman
Treehouse Moderator 68,457 PointsChris Freeman
Treehouse Moderator 68,457 PointsYou’ll need to post more code for help. Specifically, the code containing the line:
Message=show_list()
Best to include all code and complete stack trace error