This cell should remain in the output since it has no tag.
# this is a code cell
# with no plot in the output
# so it should be gone
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
This markdown cell should also remain. Look at the plot of this function:
$$\Large f(x) = cos(2x) + e^x$$This cell should be gone.
# this cell should remain because it has a plot
x = np.linspace(0,10,1000)
y = np.cos(2*x) + np.exp(x)
plt.plot(x,y)
[<matplotlib.lines.Line2D at 0x7f36964118d0>]
# this code cell should remain, since it has the "include" tag
y = 2*x
print(y[0:5])
[0. 0.02002002 0.04004004 0.06006006 0.08008008]
This MD cell should also remain, because it's included
# this plot should be excluded, since it's tagged as "ignore"
plt.plot(x,y**2)
[<matplotlib.lines.Line2D at 0x7f3695d45c88>]
def negate(x):
return not x
def square(x):
return x**2
import otter
n = otter.Notebook("tests")
n.check_all()
q1
All tests passed!
q2
0 of 1 tests passed
Tests failed:
tests/q2.py
Test code:
>>> 1 == 1 False
Test result:
Trying: 1 == 1 Expecting: False ********************************************************************** Line 2, in tests/q2.py 1 Failed example: 1 == 1 Expected: False Got: True
q3
All tests passed!
q4
All tests passed!
q5
All tests passed!