Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
216,057 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.