Skip to content

Commit ead7d63

Browse files
committed
Fix indexing in yield example
1 parent 502d7ed commit ead7d63

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

book/manuals/intros/alpaca2/extras.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@
5252
" print(\"There \", j)\n",
5353
"\n",
5454
"### OUTPUT\n",
55-
"# Here 1\n",
56-
"# There 2\n",
57-
"# Here 2\n",
58-
"# There 3\n",
55+
"# Here 0\n",
56+
"# There 1\n",
57+
"# Here 1\n",
58+
"# There 2\n",
59+
"# Here 2\n",
5960
"# ...\n",
6061
"```\n",
6162
"\n",
@@ -72,13 +73,14 @@
7273
" print(\"There \", j)\n",
7374
"\n",
7475
"### OUTPUT\n",
76+
"# Here 0\n",
7577
"# Here 1\n",
7678
"# Here 2\n",
7779
"# Here ..\n",
80+
"# There 0\n",
7881
"# There 1\n",
7982
"# There 2\n",
80-
"# There 3\n",
81-
"# ...\n",
83+
"# There ...\n",
8284
"```\n",
8385
"\n",
8486
"As you can see the main difference is with `yield` the function doesn't stop it continues. Where as returning needs the whole function the be finished.\n",

0 commit comments

Comments
 (0)