pm21-dragon/lectures/lecture-01/3 - Jupyter notebook environment.ipynb
2024-10-25 06:36:44 +02:00

3.7 KiB

None <html> <head> </head>

The Jupyter notebook environment (formerly IPython notebooks)

Articles:

Jupyter notebooks let you execute Python code in a browser.

They have advantages and disadvantages compared to other ways of running Python code. We will start with them in this class to rapidly get programming.

In this course, we encourage you to install and run Anaconda Python on your own computer.

In [3]:
# this is a comment.
In [4]:
a = 4

The result of the last line is displayed in the notebook environment.

In [6]:
a
Out[6]:
4
In [7]:
a = 5
In [8]:
a
Out[8]:
5

Good practice - "restart and run all" in your notebooks

It is good practice to "Kernel -> restart and run all" prior to finishing work on a Jupyter notebook. This ensures that your notebook can execute code from top to bottom, as it is displayed.

Automatic tests

In this course, we have a number of automatic tests such as the following. These allow you to check that your answer is correct before moving on.

In [28]:
# This is an automatic test.

assert a==5

Jupyter Lab

Files side bar.

Server runs in your computer. Your browser connects to "Localhost".

</html>