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 Continue

Gilang Ilhami
Gilang Ilhami
12,045 Points

Can't figure out the second part of "Continue"

Hmm it seems i can't figure out the functions

breaks.py
def loopy(items):
    for stuff in items:
        if stuff == 'STOP':
            break
        elif stuff.items[0] = "a":
            continue
        else:
            print(stuff)
    # Code goes here

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I'm going to give some hints and hopefully these will help you figure this out on your own.

  • The completed code only needs an if and an else.
  • The challenge does not require you to do anything specific if stuff == "STOP", so that can be removed
  • stuff[0] should be compared to "a". Not stuff.items[0]
  • The single equals is an assignment operator, not a comparison

Hope this helps, but let me know if you're still stuck! :sparkles: