官术网_书友最值得收藏!

How does it look when we execute scripts?

If we were to provide a name for the notebook, enter a simple Python script, and execute the notebook cells, we would see a display like this:

The script is:

name = "Dan Toomey"
state = "MA"
print(name + " lives in " + state)

We assign a value to the name and state variables and then print them out.

If you notice, I have placed the statements into two different cells. This is just for readability. They could all be in the same cell or three different cells.

There are line numbers assigned to each cell. The numbering always starts at 1 for the first cell, then as you move cells around the numbering may grow (as you can see the first cell is labeled cell 2 in the display).

Below the second cell, we have non-editable display results. Jupyter always displays any corresponding output of a cell just below. This could include error information as well.

主站蜘蛛池模板: 五指山市| 和顺县| 同仁县| 财经| 资中县| 蒲江县| 临海市| 家居| 信丰县| 拜城县| 嵊泗县| 浦北县| 九龙县| 临沭县| 永昌县| 霸州市| 江津市| 班玛县| 滨海县| 泌阳县| 北碚区| 凤冈县| 志丹县| 当雄县| 万全县| 内丘县| 酉阳| 清新县| 新田县| 柘城县| 隆回县| 天峨县| 彭泽县| 贵溪市| 双辽市| 邢台县| 沙坪坝区| 南丰县| 天祝| 禄丰县| 博野县|