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

Thomas Irons
Thomas Irons
2,824 Points

My code doesn't pass the challenge. Any ideas on what might be wrong?

def loopy(items): for thing in items: if thing[0] == "a": continue else: print(thing)

breaks.py
def loopy(items):
  for thing in items:
    if thing[0] == "a":
      continue
    else:
      print(thing)

3 Answers

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

I agree with Brian Jensen. When I copy/paste your code into the challenge, it passes. It could be that sometime when you were typing the challenge you managed to indent a line using a tab instead of spaces or vice versa. Python doesn't allow the mixing of tab and space indentation within the same file. Try copy/pasting your code you posted here into the challenge and retest your work. You might have to restart the challenge for this. Good luck! :sparkles:

Thomas Irons
Thomas Irons
2,824 Points

Thank you for the tips. I didn't know about the tab/space mix. The code worked fine on my laptop. It didn't work on my cell phone for some reason.

Thomas Irons
Thomas Irons
2,824 Points

Thank you. I was using my cell phone when it didn't pass. I tried it on a laptop and it did fine. That's not the first time I had issues with passing code challenges from the cell phone. Thank you again, looks like mobile is not reliable when completing challenges.