Skip to content

Commit 6f38eeb

Browse files
committed
up
1 parent 9f49287 commit 6f38eeb

File tree

2 files changed

+68
-9
lines changed

2 files changed

+68
-9
lines changed

myst.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# See docs at: https://mystmd.org/guide/frontmatter
22
version: 1
33
project:
4+
plugins:
5+
- https://github.com/jupyter-book/myst-plugins/releases/download/exercise-and-solution-pdf/exercise-admonition-pdf.mjs
6+
- https://github.com/jupyter-book/myst-plugins/releases/download/Admonitions/experiment-admonition.mjs
7+
- https://github.com/jupyter-book/myst-plugins/releases/download/Admonitions/intermezzo-admonition.mjs
8+
- https://github.com/TUD-JB-Templates/JB2_plugins/releases/download/example/example.mjs
9+
- https://github.com/jupyter-book/myst-plugins/releases/download/updated-date-frontmatter/update-date-frontmatter.mjs
10+
# - plugins/aside.mjs
11+
# - https://github.com/jupyter-book/myst-plugins/releases/download/Admonitions/example-admonition.mjs
12+
# - https://github.com/jupyter-book/myst-plugins/releases/download/iframe-to-qr-pdf/iframe-to-qr-pdf.mjs
13+
# - plugins/iframe2.mjs
14+
- plugins/typst_eq.mjs # for unknown symbols in typst
15+
- https://github.com/jupyter-book/myst-plugins/releases/download/page-last-updated/page-last-updated.mjs
16+
417
id: bfa66ee1-fd85-4563-8fb7-04c22ec8dbd3
518
title: '42H: 파이썬'
619
# authors:

starting.ipynb

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@
1212
"cell_type": "markdown",
1313
"metadata": {},
1414
"source": [
15-
":::{admonition} 구글 코랩에서 바로 실행\n",
16-
":class: note\n",
17-
"\n",
18-
"아래 링크로 `starting.ipynb`를 **Google Colab**에서 열어 바로 실행할 수 있다.\n",
19-
"\n",
20-
"- https://colab.research.google.com/github/codingalzi/code-workout-python/blob/master/starting.ipynb\n",
21-
"\n",
22-
"코랩에서는 각 셀을 `Shift+Enter`로 실행하며, 실행 결과는 셀 아래에 표시된다.\n",
15+
":::{note} 구글 코랩에서 실행\n",
2316
"\n",
17+
"[Google Colab: 프로그래밍 맛보기](https://colab.research.google.com/github/codingalzi/code-workout-python/blob/master/starting.ipynb)에서 열어 바로 실행할 수 있다.\n",
18+
"구글 코랩에서는 각 셀을 `Shift+Enter` 단축키 조합으로 실행하며, 실행 결과는 셀 아래에 표시된다.\n",
2419
":::"
2520
]
2621
},
@@ -119,7 +114,7 @@
119114
"\n",
120115
"이 자료는 Jupyter 노트북 환경을 기준으로 한다.\n",
121116
"\n",
122-
"- 셀의 **마지막 (expression)** 은 `print()` 없이도 결과가 화면에 표시될 수 있다.\n",
117+
"- 셀의 **마지막 표현식(expression)** 은 `print()` 없이도 결과가 화면에 표시될 수 있다.\n",
123118
"- `.py` 파일(스크립트)에서는 보통 `print()`를 써야 화면에 출력된다.\n",
124119
":::"
125120
]
@@ -285,6 +280,18 @@
285280
"예를 들어 아래 코드는 변수 `a`가 가리키는 값에 2를 곱한 결과를 변수 `b`가 가리키도록 한다."
286281
]
287282
},
283+
{
284+
"cell_type": "markdown",
285+
"metadata": {},
286+
"source": [
287+
":::{admonition} 표현식과 명령문\n",
288+
":class: info\n",
289+
"\n",
290+
"프로그래밍에서 값을 만들어내는 코드를 **표현식**<font size='2'>expression</font>이라 하고, 컴퓨터에게 특정 작업을 수행하도록 지시하는 코드를 **명령문**<font size='2'>statement</font>이라 한다.\n",
291+
"예를 들어 `3 + 5`는 8이라는 값을 만들어내므로 표현식이고, `a = 3`은 변수 할당이라는 작업을 수행하므로 명령문이다.\n",
292+
":::"
293+
]
294+
},
288295
{
289296
"cell_type": "code",
290297
"execution_count": 5,
@@ -510,6 +517,21 @@
510517
"- 숫자로 시작: 숫자로 시작하면 안된다는 규칙을 어겼기에 구문 오류(`SyntaxError`)가 발생한다."
511518
]
512519
},
520+
{
521+
"cell_type": "markdown",
522+
"metadata": {},
523+
"source": [
524+
"**파이썬 코딩 관례**\n",
525+
"\n",
526+
"문법적으로 강제되지는 않지만, 파이썬 프로그래머들은 변수 이름을 지을 때 **스네이크 표기법**<font size='2'>snake_case</font>을 따른다.\n",
527+
"스네이크 표기법은 모든 글자를 소문자로 작성하고, 단어 사이를 밑줄 `_`로 연결하는 방식이다.\n",
528+
"\n",
529+
"- 좋은 예: `user_name`, `student_id`, `total_score`\n",
530+
"- 파이썬에서 잘 안 쓰는 예(카멜 표기법): `userName`, `studentId`, `totalScore`\n",
531+
"\n",
532+
"협업을 위해 이러한 관례를 따르는 것이 권장된다."
533+
]
534+
},
513535
{
514536
"cell_type": "code",
515537
"execution_count": 12,
@@ -1174,6 +1196,30 @@
11741196
"**주의사항**"
11751197
]
11761198
},
1199+
{
1200+
"cell_type": "markdown",
1201+
"metadata": {},
1202+
"source": [
1203+
"**자료형 확인**\n",
1204+
"\n",
1205+
"파이썬의 모든 값은 고유한 **자료형**<font size='2'>data type</font>을 가진다.\n",
1206+
"`type()` 함수를 사용하면 값의 자료형을 확인할 수 있다.\n",
1207+
"- `int`: 정수<font size='2'>integer</font>\n",
1208+
"- `float`: 부동소수점<font size='2'>floating-point number</font>\n",
1209+
"- `str`: 문자열<font size='2'>string</font>"
1210+
]
1211+
},
1212+
{
1213+
"cell_type": "code",
1214+
"execution_count": null,
1215+
"metadata": {},
1216+
"outputs": [],
1217+
"source": [
1218+
"print(type(3))\n",
1219+
"print(type(3.0))\n",
1220+
"print(type(\"3\"))"
1221+
]
1222+
},
11771223
{
11781224
"cell_type": "markdown",
11791225
"metadata": {},

0 commit comments

Comments
 (0)