In Jupyter Notebooks, code is added in the In sections. The code can be added line by line, as the code variables and imported modules will be saved in memory, or it can be added in blocks/multiple lines, like a script. The In sections can be edited and run over and over, or they can be left alone, and a new section can be started. This creates a record of the scripting efforts, along with the interactive output.
Here is a GIST explaining lots of useful keyboard shortcuts for Jupyter Notebooks:
https://gist.github.com/kidpixo/f4318f8c8143adee5b40
https://gist.github.com/kidpixo/f4318f8c8143adee5b40