Skip to content

Commit bb41f2d

Browse files
committed
pull out code-cell until supported
1 parent d021357 commit bb41f2d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lectures/functions.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,13 @@ Use no import besides `from numpy.random import uniform`.
355355

356356
## Solutions
357357

358-
````{solution} exercise_1
358+
```{solution} exercise_1
359359
:label: solution_1
360360
361361
Here's one solution.
362362
363+
```
364+
363365
```{code-cell} python3
364366
def factorial(n):
365367
k = 1
@@ -369,10 +371,10 @@ def factorial(n):
369371
370372
factorial(4)
371373
```
372-
````
373374

374375
````{solution} exercise_2
375376
:label: solution_2
377+
````
376378

377379
```{code-cell} python3
378380
from numpy.random import uniform
@@ -387,12 +389,12 @@ def binomial_rv(n, p):
387389
388390
binomial_rv(10, 0.5)
389391
```
390-
````
391392

392-
````{solution} exercise_3
393+
```{solution} exercise_3
393394
:label: solution_3
394395
395396
Here's a function for the first random device.
397+
```
396398

397399
```{code-cell} python3
398400
from numpy.random import uniform
@@ -414,7 +416,9 @@ def draw(k): # pays if k consecutive successes in a sequence
414416
draw(3)
415417
```
416418

419+
```{solution} exercise_3
417420
Here's another function for the second random device.
421+
```
418422

419423
```{code-cell} python3
420424
def draw_new(k): # pays if k successes in a sequence
@@ -433,4 +437,4 @@ def draw_new(k): # pays if k successes in a sequence
433437
434438
draw_new(3)
435439
```
436-
````
440+

0 commit comments

Comments
 (0)