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

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.

主站蜘蛛池模板: 开平市| 武定县| 敦化市| 云浮市| 高密市| 汉川市| 太保市| 田林县| 介休市| 巫溪县| 正镶白旗| 迭部县| 讷河市| 镇江市| 灵川县| 泰和县| 长垣县| 灌阳县| 朔州市| 宜宾市| 灵台县| 安顺市| 内乡县| 乌拉特后旗| 克什克腾旗| 怀化市| 明水县| 太白县| 望奎县| 九寨沟县| 自治县| 南宫市| 修文县| 塔城市| 盘锦市| 紫金县| 丘北县| 内丘县| 密云县| 平顺县| 大姚县|