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 trialKeegan Swanson
1,339 Pointsi need help
I really need help this ain't working
my_list = []
for val in range(10):
print(my_list.append(val))
Chris Freeman
Treehouse Moderator 68,441 PointsThe print
surrounding the append statement is not needed.
2 Answers
Steven Parker
231,236 PointsIt passes the challenge for me just as it is, even with the spurious "print" statement. But as Chris mentioned, the "print" isn't needed here.
Chris Freeman
Treehouse Moderator 68,441 PointsI would add that the print
outputs nothing but a blank line since the list.append
method returns None
.
Dawlat Abdul
4,606 PointsYou are trying both to append the value and print it that's why aint working.
try this:
my_list = [] for val in range(10): my_list.append(val) print(my_list[val])
Chris Freeman
Treehouse Moderator 68,441 PointsChris Freeman
Treehouse Moderator 68,441 PointsThe code above passes the challenge. What error are you seeing?