Skip to content

Commit ac58b7f

Browse files
committed
fix code reference
1 parent debd62a commit ac58b7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lectures/python_by_example.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ But they do help us illustrate some important Python syntax and semantics in a f
187187

188188
Here's a version that illustrates `for` loops and Python lists.
189189

190-
(firstloopprog)=
191190
```{code-cell} python3
191+
:name: firstloopprog
192192
ts_length = 100
193193
ϵ_values = [] # empty list
194194
@@ -274,7 +274,7 @@ x[1] # second element of x
274274
### The For Loop
275275

276276

277-
Now let's consider the `for` loop from {ref}`the program above <firstloopprog>`, which was
277+
Now let's consider the `for` loop from {ref}`the program above <firstloopprog-code>`, which was
278278

279279
```{code-cell} python3
280280
for i in range(ts_length):
@@ -342,7 +342,7 @@ On the other hand, it takes a bit of care to get right, so please remember:
342342

343343
The `for` loop is the most common technique for iteration in Python.
344344

345-
But, for the purpose of illustration, let's modify {ref}`the program above <firstloopprog>` to use a `while` loop instead.
345+
But, for the purpose of illustration, let's modify {ref}`the program above <firstloopprog-code>` to use a `while` loop instead.
346346

347347
(whileloopprog)=
348348
```{code-cell} python3

0 commit comments

Comments
 (0)