TOPIC 6: Python range ( )
Completion requirements
8. Summary
-
range() creates a sequence of numbers.
-
It is commonly used with for loops.
-
range(stop) starts from 0.
-
range(start, stop) starts from the specified value.
-
range(start, stop, step) allows you to control the interval between numbers.
-
The stop value is not included.
-
Use list() to display all the values in a range.
-
Use len() to count the number of values in a range.
-
Use the in operator to check if a value exists in a range.