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 trialBenny Shtark
743 Pointsfor some reason the challenge doesnt work, even tho it seems i did properly. items = ["abc","xyz","bbb"];
for some reason the challenge doesnt work, even tho it seems i did properly.
def loopy(items):
for item in items:
if item[0] is "a":
continue
else:
print item
loopy(items)
2 Answers
Alexander Davison
65,469 PointsYour code is really close! The code challenge works fine :)
Two errors:
- The code challenge automatically calls your function, it just causes an error (it will just say "Bummer!" it wouldn't cause any errors in Python).
- You need parentheses for the
print
function.print
in Python 2 andprint
in Python 3 are different.
You did a great job. It is normal to run into these kind of errors :) Don't worry it happens to everyone.
If you fix those, your code should look like:
def loopy(items):
for item in items:
if item[0] is "a":
continue
else:
print(item)
Good luck! ~alex
David Lin
35,864 PointsAlmost ...
You don't need to call loopy, and you need to add parentheses around print (item):
def loopy(items):
for item in items:
if item[0] is "a":
continue
else:
print (item)
Benny Shtark
743 PointsThanx!
just solved that
Benny Shtark
743 PointsBenny Shtark
743 PointsThanx alot!!
I still cant get used to all this syntax.. its quite different from bash :D