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 trialMaggie Wolff
495 Pointspython basics challenge task 1 of 1 "Continue"
I know I'm probably not using 'index' correctly, but someone please help.
def loopy(items):
# Code goes here
"dog, ant, cat, bird"
for item in items:
if index 0 == 'a':
continue
print(item)
2 Answers
Thomas McDonnell
8,212 PointsHi Maggie, Why do you have a string "dog, ant, cat, bird" in your function?
but yes your right if you want to point to a particular index you need to use the brackets [] so it would look like this:
if index[0] == 'a': continue
but I think you also need an else statement for print(item)
def loopy(items): ...: for item in items: ...: if item[0] == "a": ...: continue ...: else: ...: print(item)
Thomas McDonnell
8,212 PointsHappy to help
Maggie Wolff
495 PointsMaggie Wolff
495 PointsTHANK YOU SO MUCH!