More concise language and an example code. (#25421)
Erase an unnecessary word from the initial description. Add an example function call above where the parameters are explained for a more visual learning experience.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
title: Range Method
|
title: Range Method
|
||||||
---
|
---
|
||||||
# Range Function
|
# Range Function
|
||||||
If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions:
|
If you need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions:
|
||||||
|
|
||||||
#### Example Usage
|
#### Example Usage
|
||||||
```py
|
```py
|
||||||
@ -20,6 +20,10 @@ for i in range(5):
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Example with optional additional arguments
|
#### Example with optional additional arguments
|
||||||
|
```py
|
||||||
|
# A range function call.
|
||||||
|
range(start, stop, step)
|
||||||
|
```
|
||||||
The first argument, *start*, is the starting number of the sequence.
|
The first argument, *start*, is the starting number of the sequence.
|
||||||
|
|
||||||
The second argument, *stop*, means to generate numbers up to, but not including this number.
|
The second argument, *stop*, means to generate numbers up to, but not including this number.
|
||||||
|
Reference in New Issue
Block a user