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

Hello Brown
Hello Brown
531 Points

NameError: name 'loopy' is not defined why? function got name

def loopy(items):
    # Code goes here
    i = 0
    while i < items.length:
      if items[i] == "a":
        continue
      else:
        print(items[i])
      i = i + 1

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Hello;

Welcome to Treehouse!

For this challenge you can get through it using a for loop.

def loopy(items):
    # Code goes here
    for item in items:
      if item[0] == 'a':
        continue
      else:
        print(item)

Post back if you have additional questions.

Happy coding,
Ken

Hello Brown
Hello Brown
531 Points

Hi, thanks for answer. I did not understand the task

Hi!

I'm not 100% sure that this will fix your issue but you are not closing your loopy function at all. This might be causing the error that you are experiencing.

-Luke

Hello Brown
Hello Brown
531 Points

Hi,

next time i closed the function but it did not do nothin. Thanks for answer :) i am already have the decision.