Title: 2
Course: Start programming with Python in 10 steps

Watch Python code demo

Only several years ago, you would first learn how to use a shell from a command line before even starting to program. This is not the case any more since special developer apps provide us with pretty much everything that we need in order to start writing and running programs. In this step, you learn how to write and run programs with the help of special apps called notebooks. To see how these apps work, you will download on your computer and open an example notebook that we prepared for you. Later on in this guide, we will go back to shells and the command line, which are still very much needed for carrying out more advanced projects. For now, you can sit back and enjoy the comfort of notebooks. Let’s try them out and play around with the basics first.

👉    6 things to know at this step

1. Jupyter is one of the most popular apps for writing and running Python notebooks.
2. Jupyter can be installed in many ways, but we installed it as part of Anaconda.
3. A Jupyter notebook is a special file which you will recognise by the suffix .ipynb in its name. You can probably open a .ipynb file with other apps too, but only the Jupyter app will make it look meaningful.
4. Jupyter uses your main web browser (e.g. Chrome, Firefox, Safari) to show you the content of its files. This is why the app looks like a web page that you can edit.
5. The main unit of a Jupyter notebook is a cell. There are two kinds of cells that you can edit: text (for explaining what your code is doing) and code (where you type in your programs). When you run a code cell, Jupyter creates a new cell where it shows the output of your program.
6. Python code needs to be run by a Python interpreter in order to be understood by your computer. Jupyter also does that for you.

🧑‍🎓    Learn actively

📝   Read about Jupyter on Wikipedia.

🛠️   Download this notebook and save it some place where you can easily find it.
        IMPORTANT: you need to right-click on the link and then select "Save link as".
        You might want to check the PDF version of the notebook too, but that's just for reading.
        It might be a good idea to create a folder where you will keep all the files that you will create in this tutorial.

▶️   Start Anaconda and then open Jupyter (we installed both in Step 1).

▶️   Open the notebook just like you would open any file in any app (check the menus and buttons in the upper part of the screen).

▶️   Get ready for the next step by trying to understand what is going on in the notebook. Run all the code cells, then edit them (change something that makes sense to change) and run them again. You don't need to actually read the entire notebook at this point!
❗ To run a code cell, use the Run button in the upper part of the screen or the ⏯️ button next to the cell that you want to run. You can change the type of the cell by choosing "Code" or "Markdown" in the drop-down menu.
❗ Don't worry if you "break" something, you can always get a new copy of the correct notebook from here.

📝   At this point, we are using Jupyter to interpret and execute our Python code. You can also use Python in interactive mode, but we'll come back to that in the next step. Just keep in mind that interactive Python is also something that exists.

❓ Check if you got everything right

  - Create a new text cell and a new code cell
  - Create a new notebook yourself and save it, add a few cells.

     If you don't know what to put in the cells, feel free to copy/paste from the downloaded notebook.