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

FOR and IF loops

Hi,

I really want to get more additional questions (10-15 questions) on FOR and IF loops; since practicing helps me get better and I want to perfectly understand the FOR and IF loops.

Thanking You, Poro

breaks.py
def loopy(items):
    for thing in items:
        if thing == "STOP":
            break
        else:
            print (thing)

2 Answers

Steven Parker
Steven Parker
231,248 Points

You just want some extra practice?

You can easily make up some tasks and try them out in the workspace, but if you want some pre-made challenges you might just look around on the web. A few free sources of python practice problems I found with a quick search are:

Thank you Steven

Note: IFs, ELSEs and ELIFs aren't loops, they are control flow or more formally conditions.

FORs and WHILEs are loops, though. :)

Just a note.