To do that, you can use the range () function. By calling list(range(100)) it returns a list of 100 numbers. Writing them out by hand would be very time consuming, so instead use the range function: Python starts counting from zero. Now what if you want to count from 1 to 100? A third parameter defines the step size, by default its one.
Master the Python range () function and learn how it works under the hood. You most commonly use ranges in loops. In this tutorial, you'll learn how to iterate over ranges but also identify when there are better alternatives.