Python Python Basics (2015) Shopping List App Break

Steven Gutierrez
Steven Gutierrez
Full Stack JavaScript Techdegree Student 7,287 Points

Am I putting IF statement in the wrong place?

Is IF in the wrong place?
def loopy(items):
    for item in (items):

    if item == "STOP":

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Moderator

Hi there! Yes, it is. Currently your code will print the word "STOP" if it's entered because it does the print before the check. We want to print everything but "STOP" then exit if it is "STOP". Also, your if statement should be inside the for loop.

Hope this helps! :sparkles: