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 Python Basics (2015) Shopping List App Break

Birunthaban Rajendram
PLUS
Birunthaban Rajendram
Courses Plus Student 457 Points

Pls help me..... This is so confusing

Can anyone help me to figure this out

breaks.py
def loopy(items):
    # Code goes here
    for loopy in items:
        print(items)

        if items == "STOP":
            break

1 Answer

Steven Parker
Steven Parker
231,275 Points

You're close, but have a few issues:

  • the name of the function is "loopy", you should pick a different name to represent each item
  • you'll want to test and print the individual item, not all the "items"
  • to avoid printing the word "STOP", the print should come after the test and break
Birunthaban Rajendram
Birunthaban Rajendram
Courses Plus Student 457 Points

Please can you show me the solution for that challenge... I still dont understand

Steven Parker
Steven Parker
231,275 Points

I don't like giving explicit spoilers, but you might find some, or more helpful hints, if you look at some of the other questions asked about his same challenge.