--- title: Notebook with errors keywords: fastai sidebar: home_sidebar nb_path: "venv/Lib/site-packages/nbconvert/tests/files/notebook3_with_errors.ipynb" ---
This notebook contains a cell which deliberately throws an exception. This is to test if nbconvert
stops conversion if the flag --execute
is given without --allow-errors
. In the cells before and after the one which raises the exception we compute a couple of numbers. If they exist in the output we know that the respective cells were executed.
print("Hello world, my number is {}".format(24 - 1))
print("Some text before the error")
raise RuntimeError("This is a deliberate exception")
print("The answer to the question about life, the universe and everything is: {}".format(43 - 1))