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

challenge 1

I'm not exactly sure I have it all right but I have even written it exactly how others have gotten it right and I still get errors (mostly "didn't find all the right things in items)

breaks.py
def loopy(items):
    for thing in items:
        while thing is True:
              print(thing)
        if thing == "STOP":
            break

2 Answers

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

you don't need the while, you are just looping through the items, if it says stop, break, else, print, so you need to test for stop first before printing. it doesn't want you to print the stop item, you gotta break before that.

Never mind, I tried my original answer (not the one i posted)and it passed I might have had another small error the first time but thanks James

Okay i removed the while and put if thing == 'STOP' break .....then the print but it still says "didn't find the right items to print"