For Loop with range()
1 min read ·
range() is used to generate a sequence of numbers and is commonly used with a for loop.Basic Syntax
startis optional (default0)stopis excluded
Simple Example
range(start, stop)
range(start, stop, step)
Reverse Loop Using range()
Common Mistake
Note
range() always excludes the stop value.