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 Introducing Lists Build an Application Display the List

Error 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

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

You’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

3 Answers

Steven Parker
Steven Parker
231,236 Points

The 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.

#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]

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

Steven Parker is correct.

This

def show_list(item):

should be this

def show_list():

Awesome that worked thanks a million for your help.