Skip to content

Commit a2e9391

Browse files
committed
update Iterator Pattern
1 parent 2e813d3 commit a2e9391

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

notebooks/IteratorPattern.ipynb

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,27 @@
205205
" print(i)"
206206
]
207207
},
208+
{
209+
"cell_type": "code",
210+
"execution_count": 2,
211+
"id": "f4d68690",
212+
"metadata": {},
213+
"outputs": [
214+
{
215+
"data": {
216+
"text/plain": [
217+
"True"
218+
]
219+
},
220+
"execution_count": 2,
221+
"metadata": {},
222+
"output_type": "execute_result"
223+
}
224+
],
225+
"source": [
226+
"10 in range(1, 20, 1)"
227+
]
228+
},
208229
{
209230
"cell_type": "code",
210231
"execution_count": 15,
@@ -560,7 +581,7 @@
560581
" - called **lazy** evaluation; reluctantly produce values on demand\n",
561582
"- to create a generator expression, warp the comprehension in `( )` INSTEAD of `[ ]` or `{ }`\n",
562583
"- wrapping a generator in `{ }` creates a set\n",
563-
"- warpping a generator in `{ : }` creaes a dict\n",
584+
"- warpping a generator in `{ : }` creates a dict\n",
564585
"- warpping a generator in `[ ]` creates a list\n",
565586
"- wrapping a generator in `( )` creates a generator expression NOT a tuple"
566587
]
@@ -1598,7 +1619,7 @@
15981619
],
15991620
"metadata": {
16001621
"kernelspec": {
1601-
"display_name": "oop",
1622+
"display_name": "Python 3",
16021623
"language": "python",
16031624
"name": "python3"
16041625
},
@@ -1612,7 +1633,7 @@
16121633
"name": "python",
16131634
"nbconvert_exporter": "python",
16141635
"pygments_lexer": "ipython3",
1615-
"version": "3.10.9"
1636+
"version": "3.9.6"
16161637
}
16171638
},
16181639
"nbformat": 4,

0 commit comments

Comments
 (0)