Python Python Sequences Sequence Iteration Iterating over Ranges

Haasini Beeravolu
Haasini Beeravolu
616 Points

I do not know how to do this.

I do not know what to do here.

iterating_ranges.py
my_list = []

1 Answer

Peter Vann
MOD
Peter Vann
Treehouse Moderator 35,258 Points

Hi Haasini!

Try this:

my_list = []

for val in range(10):
    my_list.append(val)

More info:

https://www.w3schools.com/python/ref_func_range.asp

I hope that helps.

Stay safe and happy coding!