Python Python Sequences Sequence Iteration Iterating over Ranges

i need help

I really need help this ain't working

iterating_ranges.py
my_list = [] 
for val in range(10): 
    print(my_list.append(val))
Chris Freeman
Chris Freeman
Treehouse Moderator 62,868 Points

The code above passes the challenge. What error are you seeing?

Chris Freeman
Chris Freeman
Treehouse Moderator 62,868 Points

The print surrounding the append statement is not needed.

2 Answers

Steven Parker
Steven Parker
205,345 Points

It 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
Chris Freeman
Treehouse Moderator 62,868 Points

I would add that the print outputs nothing but a blank line since the list.append method returns None.

Dawlat Abdul
Dawlat Abdul
4,606 Points

You 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])