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 trial

Python Python Sequences Sequence Iteration Iterating over Ranges

write a loop that iterates over a range with a stop value of 10,start value is 0,stop is 10,step is 1

the body of the loop should append the current value to the provided list called,to append a value to a list,use the syntax my_list.append(val).

iterating_ranges.py
my_list = []

1 Answer

Steven Parker
Steven Parker
231,275 Points

It doesn't look like you've started yet, you should at least give it your best "good faith" try and post your code with the question.

But some general hints:

  • the instructions ask for a loop
  • the loop will use a range
  • the endpoints for the range are given in the instructions (0 and 10)
  • the loop will append values to the list
  • the instructions tell you to append using "my_list.append( val )" syntax