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

Bryony Stewart
Bryony Stewart
1,230 Points

Am I missing the point?

Has anyone got any tips on how to deal with dyslexia and learning programming languages? I get really bad writers block when I am asked to code something. And don't know what tools to use for the job, e.g. (lists,functions,args,strings,floats.)

breaks.py
def loopy(items):
    # Code goes here
    for items in items:
        print (items)

        if items == "STOP"
            break 

1 Answer

Steven Parker
Steven Parker
231,275 Points

:point_right: You have a few issues here:

  • the if statement needs a colon at the end
  • the if and the break must both come before the print to prevent the "STOP" from showing
  • while it may work here, it will generally be a good idea to use a different name for the iterating variable
  • the iterating variable is often named using the singular version of the variable with the collection

I don't know much about dyslexia, but I can say that I have given similar hints to many students, almost certainly including those who do not have that challenge.