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

I need you to help me finish my loopy function. Inside of the function, I need a for loop that prints each thing in item

here is my answer to the question, i don´t know if it´s incorrect

def loopy(items): for i in items: print i loopy(items)

breaks.py
def loopy(items):
    # Code goes here
    for i in items:
        print i
loopy(items)
Alexandra Barnett
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi Junior! You almost had it right! Your print function needs brackets and you don't need to call the function at the bottom:

def loopy(items):
    # Code goes here
    for i in items:
        print(i)

3 Answers

Yes it´s correct , Thx u very much!

I tried using the same code for this same exercise, and it didn't work for me, for some reason - Did I miss something?...

def loopy(items):
    # Code goes here
for i in items:
    print(i)
Alexandra Barnett
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi SC3!

The for loop needs to be inside the function and in Python, that means the for loop has to be indented by one tab to be inside. Hope that helps! Let me know if you have any more problems :).

Okay, that worked - Thank you, Alexandra... P :)