range
Resources
- Official documentation for the range function.
range
range returns an iterable that will yield the integers up to the given stop or from the given start up to the given stop.
You will see the range object most commonly used in the for loops, for when you want an index instead of iterating through an iterable object.
Exercises
Create a list of numbers up to 20
Note
Print, in a for loop, the numbers from 20 to 30.
Note
Sum all integers from 1 to 1000
Note
Create a list of all multiples of 7 smaller than 100.
Note