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

Carole Cox
Carole Cox
429 Points

I thought I answered the question correctly but something is wrong?

Following Kenneth's lecture, I think I am answering the Challenge correctly but I cannot get a pass. Hitting the wall.

breaks.py
def loopy(items):
   items= [car, truck, "Stop"]
for item in items:
    if item = "STOP":
    break
    print item
    # Code goes here

4 Answers

Carole, you don't need to supply the list. The challenge will do that for you.

def loopy(items):
    # Code goes here
    for item in items:
      if item == "STOP":
        break
      print(item)

Also, you need == for equals, not =. And python is VERY picky about indentation. You must indent after a for, after an if, etc.

Carole Cox
Carole Cox
429 Points

Thank you! I appreciate your guidance!

You are welcome.

Happy coding!

Carole Cox
Carole Cox
429 Points

Thank you! Its an uphill battle I hope I can conquer. I really need a career change. Although kind of late in life, I need it and I hope this will become a good fit. I need something that is more brain than brawn. I am so grateful for your help!

I'm sure you will; conquer, that is.

Yes, it can seem daunting at times. We all go through that part. But keep positive, and keep at it, and it will become clearer.