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 trialLalit Aditya
400 PointsI need you to help me finish my loopy function. Inside of the function, I need a for loop that prints each thing in item
What was wrong in my code?
def loopy(items):
# Code goes here
for item in items:
print(item)
loopy(['apple', 'mango'])
2 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsYou don't need to include the data in your code. Remove the loopy
array and the code will pass!
The code challenge will assume the data exists! :-)
Lalit Aditya
400 PointsThanks Jonathan, it worked!!!!
Lalit Aditya
400 PointsLalit Aditya
400 PointsI removed the loopy array but it did not work. It gave the error "loopy() missing 1 required positional argument: 'items' ".!!!
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsThat's weird.
This code below is enough for me to pass Task 1. It doesn't really ask for an array, nor does the 2nd task.