What does the range() function do?
The range() function can return a sequence of numbers.
1. The sequence starts at 0
2. Increments by 1
3. Stops before a specified number
Syntax:
range(start, stop, step)
Keep in mind that:
Start is optional
Stop is required
Step is optional
We will try to answer the following questions using the range() function
Print numbers 1 to 5
Print your name 10 times
Print numbers 10 to 1 [10,9,8,7 and so on…]
Print all the even numbers from 1 to 20
Print all the odd numbers from 19 to 1 [ 19, 17, 15 and so on…]
Print all the multiples of 10 from 10 to 100