Feature: Add an example with additional arguments
Show an example which uses the additional, optional arguments (start and step) for the range function.
This commit is contained in:
committed by
Kristofer Koishigawa
parent
e182884725
commit
1160e4e9bf
@ -19,3 +19,20 @@ for i in range(5):
|
|||||||
4
|
4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Example with optional additional arguments
|
||||||
|
The first argument, *start* includes the number at which to start the progression.
|
||||||
|
The second argument, *stop* is the same as in the example above, and the progression stops before this number.
|
||||||
|
The third argument, *step* is for when you want to generate numbers, but at a step greater than one.
|
||||||
|
```py
|
||||||
|
for i in range(3,12,2):
|
||||||
|
print(i)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Output
|
||||||
|
```
|
||||||
|
3
|
||||||
|
5
|
||||||
|
7
|
||||||
|
9
|
||||||
|
11
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user