Python Python Sequences Sequence Iteration Iterating over Ranges

Emily Strobl
Emily Strobl
5,259 Points

what am i doing wrong

no matter what i do i keep getting errors

iterating_ranges.py
my_list = []
my_list.append('item')
for item in range(10):
    print(item)

1 Answer

Efaz Khan
Efaz Khan
5,194 Points

Hi, you need to append to the list inside the for loop

my_list = []
for i in range(10):
    my_list.append(i)