Skip to content

Commit 87a7cfe

Browse files
committed
Upload README
1 parent 29d9a6f commit 87a7cfe

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ Here some example of how to use Streams:
135135
Stream.randint(1, 100).limit(100).toList()
136136
```
137137

138-
* Generate a list of the numbers from 1 to 100
138+
* Print the numbers from 1 to 100
139139
```py
140-
Stream.iterate(1, lambda i: i + 1).limit(100).toList()
140+
Stream.iterate(1, lambda i: i + 1).limit(100).forEach(print)
141141
```
142142

143143
* Generate a list of squares of the number from 1 to 100
@@ -150,6 +150,16 @@ Stream.iterate(1, lambda i: i + 1).map(lambda x: x**2).limit(100).toList()
150150
Stream.generate(lambda: 0).limit(100).toList()
151151
```
152152

153+
* Generate a set of the first 100 odds number
154+
```py
155+
Stream.odds().limit(100).toSet()
156+
```
157+
158+
* Generate a list of all the primes number smaller than 100
159+
```py
160+
Stream.primes().filter(lambda x: x < 100).toList()
161+
```
162+
153163

154164

155165
<!-- ROADMAP -->

0 commit comments

Comments
 (0)