概要
Pythonで「Jupyter Notebookの基本操作とショートカットキー」の動作を確認してみました。以下のページを参考にしました。
実装
以下のファイルを作成しました。
file20231020.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "50978cd4-df87-43d5-95d1-4b4da549724a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "8a011ffa-5121-476f-a588-16dd24b99e35",
"metadata": {},
"outputs": [],
"source": [
"123*48"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3ece9f26-7dbc-4a63-b198-6c7b4d517651",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 1,
"id": "bf128bad-f868-4f2c-9ef8-b520197fb0e5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"13\n"
]
}
],
"source": [
"print(10+3)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c85e86ba-f76d-445e-a3bb-5f2f780f3370",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"22\n"
]
}
],
"source": [
"print(34-12)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bb7a74e0-105a-46bc-a9a1-34a73cddfe95",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 4,
"id": "70cfd46e-3de3-4e70-ad4a-d088eecc5955",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Orange\n",
"Peach\n",
"Lemon\n",
"End\n"
]
}
],
"source": [
"mylist = [ \"Orange\", \"Peach\", \"Lemon\" ]\n",
"for val in mylist:\n",
" print(val)\n",
"print(\"End\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b4f2b21c-fdd5-47dc-8af9-4b36344c0779",
"metadata": {},
"outputs": [],
"source": [
"print(\"Finish\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5f489a51-b9cd-4828-8179-502aa54d4c1d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
実行画面は以下のとおりです。
まとめ
何かの役に立てばと。