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

Generic "Bummer! Try again!" message without much other help.

So the exercise instructs to loop through every item in items. If the current item's index 0 is the letter "a", continue to the next one. Otherwise, print out every member of items. When I check my work I am simply given a "Bummer! Try again!" message. Can anyone shed more light as to what could be wrong with my code. Thank you in advance.

breaks.py
def loopy(items):
    # Code goes here
    for item in items:
      if item[0] == 'a':
         continue
      print item

3 Answers

Carlos Federico Puebla Larregle
Carlos Federico Puebla Larregle
21,074 Points

Remember that "print()" is a function so you have to use the parenthesis. You could do it like this:

def loopy(items):
    for item in items:
        if item[0] == 'a':
            continue
        print(item)

I hope that helps a little bit

Thanks for calling that out. It's something that I keep overlooking and must do a better job. However, even after adding the parenthesis; I still received the generic Bummer message.

Thank you. Helped a lot! Made me understand "for" loops better too.

Carlos Federico Puebla Larregle
Carlos Federico Puebla Larregle
21,074 Points

You have to be careful with the indentation when writing python. For example, use 4 white spaces for indentation every time so you don't end with that kinda of error.

Thank you for your feedback Carlos. That was the issue.

Thank you Carlos. I get it now. I appreciate your help.