Skip to content

Commit 22bfea4

Browse files
author
Rick Riehle
committed
Move assert into out of lecture and into exercise
1 parent 98394b8 commit 22bfea4

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

slides_sources/source/session10.rst

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Examples:
232232
233233
.. nextslide::
234234

235-
Remember this from earlier today?
235+
Get creative....
236236

237237
.. code-block:: python
238238
@@ -435,7 +435,7 @@ Closures
435435
436436
you can find a "proper" definition here:
437437
438-
https://en.wikipedia.org/wiki/Closure_(computer_programming)
438+
http://en.wikipedia.org/wiki/Closure_(computer_programming)
439439
440440
but I even have trouble following that.
441441
@@ -564,30 +564,7 @@ integer by every integer smaller than it down to 1.
564564
We can use a recursive function nicely to model this mathematical function
565565
566566
567-
``assert``
568-
----------
569-
570-
Writing ``tests`` that demonstrate that your program works is an important part of learning to program.
571-
572-
The python ``assert`` statement is useful in writing simple tests
573-
for your code.
574-
575-
.. code-block:: ipython
576-
577-
In [1]: def add(n1, n2):
578-
...: return n1 + n2
579-
...:
580-
581-
In [2]: assert add(3, 4) == 7
582-
583-
In [3]: assert add(3, 4) == 10
584-
585-
---------------------------------------------------------------------
586-
AssertionError Traceback (most recent call last)
587-
<ipython-input-3-6731d4ac4476> in <module>()
588-
----> 1 assert add(3, 4) == 10
589567
590-
AssertionError:
591568
592569
Lab: Fibonacci
593570
==============

0 commit comments

Comments
 (0)