We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7aa834 commit 243d43eCopy full SHA for 243d43e
1 file changed
README.md
@@ -8,3 +8,19 @@ https://pypi.org/project/java-stream/
8
```bash
9
pip install java-stream
10
```
11
+## Usage
12
+```py
13
+from stream import Stream
14
+
15
+# Generate a list of 100 random numbers
16
+Stream.randint(1, 100).limit(100).toList()
17
18
+# Generate a list of the numbers from 1 to 100
19
+Stream.iterate(1, lambda i: i + 1).limit(100).toList()
20
21
+# Generate a list of squares of the number from 1 to 100
22
+Stream.iterate(1, lambda i: i + 1).map(lambda x: x**2).limit(100).toList()
23
24
+# Generate a list of 0 with a lenght of 100
25
+Stream.generate(lambda: 0).limit(100).toList()
26
+```
0 commit comments