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

How do you say stop if there's an a then continue printing the other items please explain and show your work

Thank you to anyone who is willing to help with question the video before it didn't explain THIS to well.

breaks.py
def loopy(items):
    if loopy 0= 'a':
        continue 
        print(items)
    else:
        print(items)

1 Answer

Steven Parker
Steven Parker
229,732 Points

Perhaps a few hints might help:

  • "loopy" is the name of the function, you won't use it inside the function
  • as the name might imply, you will want to create a loop
  • a "for" type loop would help isolate one item at a time
  • when indexing, put the index value inside brackets []
  • nothing in the same block after a "continue" statement will ever be executed
  • be sure to print one item at a time and not all "items"