How does Jupyter execute code?
In Jupyter Notebook, you can run code and view the results. Here are some common ways to execute code:
Cell execution:
In Jupyter Notebook, code is divided into individual cells where you can input or paste code.
– After selecting a cell, execute the code in that cell by using the shortcut Shift + Enter or clicking the “Run” button on the toolbar.
– The execution results will be displayed in the output area below.
2. Sequential execution of cells:
Jupyter Notebook allows you to run code cells in order by executing them one by one. You can do this by clicking on each cell and using the Shift + Enter shortcut, or by running the cells sequentially.
Shortcut:
While in editing mode, you can also use other shortcuts to execute code, such as:
Alt + Enter:执行当前单元格并在下方插入新的空白单元格。Ctrl + Enter:执行当前单元格但不插入新的单元格。
Shift + Tab:在函数或方法后面使用此快捷键可以显示相关的帮助信息。
You can easily run the code and observe the results in any way that suits you best. Choose the most suitable way for your needs.