Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Feb 13, 2025
1 parent d0d8448 commit 4cde5e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/examples/iterators/range-with-steps/count.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
1
2
3
---
2
3
4
3.2
5.4
6 changes: 6 additions & 0 deletions python/examples/iterators/range-with-steps/test_counter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import it

def test_range():
r = it.Range(1, 6, 2.2)
result = list(r)
assert result == [1, 3.2, 5.4]
1 change: 1 addition & 0 deletions python/iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ In many aspects it behaves as an iterator. Specifically it allows us to iterate
![](examples/iterators/range-with-steps/count.py)
![](examples/iterators/range-with-steps/it.py)
![](examples/iterators/range-with-steps/count.out)
![](examples/iterators/range-with-steps/test_counter.py)


## Iterator: a counter
Expand Down

0 comments on commit 4cde5e1

Please sign in to comment.