diff --git a/docs/01python/02get-started/_samples/comment.ipynb b/docs/01python/02get-started/_samples/comment.ipynb
index 16c8539fe..ae2094909 100644
--- a/docs/01python/02get-started/_samples/comment.ipynb
+++ b/docs/01python/02get-started/_samples/comment.ipynb
@@ -6,8 +6,7 @@
{
"metadata": {},
"source": [
- "# \u3053\u306e\u90e8\u5206\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002\u6b21\u306e\u884c\u3082\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\n",
- "# print(\"Hello World!\")\n",
+ "# \u3053\u306e\u90e8\u5206\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002\n",
"print(\"Hello World!\") # \u3053\u306e\u90e8\u5206\u3082\u30b3\u30e1\u30f3\u30c8\u3067\u3059\u3002"
],
"cell_type": "code",
diff --git a/docs/01python/02get-started/_samples/comment2.ipynb b/docs/01python/02get-started/_samples/comment2.ipynb
new file mode 100644
index 000000000..23c23b7c6
--- /dev/null
+++ b/docs/01python/02get-started/_samples/comment2.ipynb
@@ -0,0 +1,26 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "# \u6b21\u306e\u884c\u306f\u3001\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\n",
+ "# print(\"Hello World!\")\n",
+ "print(\"Hello World!\")"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Hello World!\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/02get-started/_samples/comment3.ipynb b/docs/01python/02get-started/_samples/comment3.ipynb
new file mode 100644
index 000000000..4c0b52e36
--- /dev/null
+++ b/docs/01python/02get-started/_samples/comment3.ipynb
@@ -0,0 +1,27 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "\"\"\"\n",
+ "\u8907\u6570\u884c\u306e\u30b3\u30e1\u30f3\u30c8\u3082\u66f8\u3051\u307e\u3059\u3002\n",
+ "\"\"\"\n",
+ "print(\"Hello World!\")"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Hello World!\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/02get-started/index.mdx b/docs/01python/02get-started/index.mdx
index 037b41934..e012e12b2 100644
--- a/docs/01python/02get-started/index.mdx
+++ b/docs/01python/02get-started/index.mdx
@@ -36,3 +36,9 @@ import Answer from "@site/src/components/Answer";
プログラムを読みやすくするために説明を書くときや一時的にあるコードを実行しないようにするときなどによく使われます。
+
+
+
+ダブルクォーテーション 3 つ(`"""`)を使って、複数行のコメントを書くこともできます。
+
+
diff --git a/docs/01python/05function/index.mdx b/docs/01python/05function/index.mdx
index 5940265c4..edcdd2b49 100644
--- a/docs/01python/05function/index.mdx
+++ b/docs/01python/05function/index.mdx
@@ -77,7 +77,11 @@ $$
$G=6.7\times 10^{-11}$、$r=2$、$M=60$、$m=20$ とします。
-
+
+
+
+ここで `e-08` と表示されていますが、これは $10^{-8}$ という意味です。
+
### 練習問題 2
diff --git a/docs/01python/10if/_samples/comparison_operator2.ipynb b/docs/01python/10if/_samples/comparison_operator2.ipynb
new file mode 100644
index 000000000..3d1edbc96
--- /dev/null
+++ b/docs/01python/10if/_samples/comparison_operator2.ipynb
@@ -0,0 +1,26 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "age = 18\n",
+ "\n",
+ "print(10 < age < 20)"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "True\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/10if/index.mdx b/docs/01python/10if/index.mdx
index e9e2ba1a4..8c1d7ff2d 100644
--- a/docs/01python/10if/index.mdx
+++ b/docs/01python/10if/index.mdx
@@ -34,6 +34,10 @@ Python では、次のように比較演算子を用いて真偽を判定する
| `>` | 大なり | |
| `>=` | 以上 | |
+実は、Python では数学のように複数の比較演算子を使った条件も書くことができます。他の多くのプログラミング言語はこのような表記はできません。
+
+
+
## 論理演算子
論理値に対して、論理演算子を使ってさらに複雑な計算をすることができます。
@@ -109,26 +113,6 @@ else:
### 練習問題 1
-Fizz Buzz 問題を解くプログラムを作ってみましょう。
-これは、プログラミング初心者向けの簡単な例題としてとても有名です。初歩的なプログラムを作成する能力があるのかを判定するためによく使われます。
-
-Fizz Buzz のルールは、次のようになっています。
-
-> プレイヤーは円状に座る。最初のプレイヤーは「1」と数字を発言する。次のプレイヤーは直前のプレイヤーの発言した数字に 1 を足した数字を発言していく。ただし、3 の倍数の場合は「Fizz」(Bizz Buzz の場合は「Bizz」)、5 の倍数の場合は「Buzz」、3 の倍数かつ 5 の倍数の場合(すなわち 15 の倍数の場合)は「Fizz Buzz」(Bizz Buzz の場合は「Bizz Buzz」)を数の代わりに発言しなければならない。発言を間違えた者や、ためらった者は脱落となる。
-> Wikipedia フリー百科事典 より
-
-$n$ 番目まで Fizz Buzz での正しい解を表示するプログラムを作ってみましょう。
-
-
-
-
-もう一つの有名な解法を見てみましょう。
-
-
-
-
-### 練習問題 2
-
絶対値を求めるプログラムを作ってみましょう。
@@ -146,7 +130,7 @@ $n$ 番目まで Fizz Buzz での正しい解を表示するプログラムを
-### 練習問題 3
+### 練習問題 2
数学の得点の配列が与えられた時、その配列中での最大値を求めるプログラムを作ってみましょう。
与えられる配列を `[55, 32, 16, 51, 80, 19]` として実際に求めてみましょう。
diff --git a/docs/01python/10if/_samples/fizzbuzz.ipynb b/docs/01python/11practice/_samples/fizzbuzz.ipynb
similarity index 100%
rename from docs/01python/10if/_samples/fizzbuzz.ipynb
rename to docs/01python/11practice/_samples/fizzbuzz.ipynb
diff --git a/docs/01python/10if/_samples/fizzbuzz2.ipynb b/docs/01python/11practice/_samples/fizzbuzz2.ipynb
similarity index 100%
rename from docs/01python/10if/_samples/fizzbuzz2.ipynb
rename to docs/01python/11practice/_samples/fizzbuzz2.ipynb
diff --git a/docs/01python/11practice/_samples/gcd.ipynb b/docs/01python/11practice/_samples/gcd.ipynb
new file mode 100644
index 000000000..919eed9da
--- /dev/null
+++ b/docs/01python/11practice/_samples/gcd.ipynb
@@ -0,0 +1,32 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "def gcd(a, b):\n",
+ " if a < b:\n",
+ " a, b = b, a\n",
+ " while b != 0:\n",
+ " a, b = b, a % b\n",
+ " return a\n",
+ "\n",
+ "\n",
+ "print(gcd(12, 16))"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "4\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/11practice/_samples/gcd_math.ipynb b/docs/01python/11practice/_samples/gcd_math.ipynb
new file mode 100644
index 000000000..ea1a2ac5b
--- /dev/null
+++ b/docs/01python/11practice/_samples/gcd_math.ipynb
@@ -0,0 +1,26 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "import math\n",
+ "\n",
+ "print(math.gcd(12, 16))"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "4\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/11practice/_samples/gcd_recursive.ipynb b/docs/01python/11practice/_samples/gcd_recursive.ipynb
new file mode 100644
index 000000000..93ae103e0
--- /dev/null
+++ b/docs/01python/11practice/_samples/gcd_recursive.ipynb
@@ -0,0 +1,33 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "def gcd(a, b):\n",
+ " if a < b:\n",
+ " a, b = b, a\n",
+ " if b != 0:\n",
+ " return gcd(b, a % b)\n",
+ " else:\n",
+ " return a\n",
+ "\n",
+ "\n",
+ "print(gcd(12, 16))"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "4\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/11practice/_samples/prime_factorize.ipynb b/docs/01python/11practice/_samples/prime_factorize.ipynb
new file mode 100644
index 000000000..ccaf9f0c9
--- /dev/null
+++ b/docs/01python/11practice/_samples/prime_factorize.ipynb
@@ -0,0 +1,37 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "def prime_factorize(n):\n",
+ " i = 2\n",
+ " while n != 1:\n",
+ " if n % i == 0:\n",
+ " n /= i\n",
+ " print(i)\n",
+ " else:\n",
+ " i += 1\n",
+ "\n",
+ "\n",
+ "prime_factorize(24)"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "2\n",
+ "2\n",
+ "2\n",
+ "3\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/11practice/_samples/prime_number.ipynb b/docs/01python/11practice/_samples/prime_number.ipynb
new file mode 100644
index 000000000..f5037f477
--- /dev/null
+++ b/docs/01python/11practice/_samples/prime_number.ipynb
@@ -0,0 +1,63 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "def is_prime_number(n):\n",
+ " if n < 2:\n",
+ " return False\n",
+ " for i in range(2, n):\n",
+ " if n % i == 0:\n",
+ " return False\n",
+ " return True\n",
+ "\n",
+ "\n",
+ "def print_prime_number(n):\n",
+ " for i in range(1, n + 1):\n",
+ " if is_prime_number(i):\n",
+ " print(i)\n",
+ "\n",
+ "\n",
+ "print_prime_number(100)"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "2\n",
+ "3\n",
+ "5\n",
+ "7\n",
+ "11\n",
+ "13\n",
+ "17\n",
+ "19\n",
+ "23\n",
+ "29\n",
+ "31\n",
+ "37\n",
+ "41\n",
+ "43\n",
+ "47\n",
+ "53\n",
+ "59\n",
+ "61\n",
+ "67\n",
+ "71\n",
+ "73\n",
+ "79\n",
+ "83\n",
+ "89\n",
+ "97\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/11practice/_samples/prime_number2.ipynb b/docs/01python/11practice/_samples/prime_number2.ipynb
new file mode 100644
index 000000000..a7440fab1
--- /dev/null
+++ b/docs/01python/11practice/_samples/prime_number2.ipynb
@@ -0,0 +1,74 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 2,
+ "metadata": {},
+ "cells": [
+ {
+ "metadata": {},
+ "source": [
+ "import math\n",
+ "\n",
+ "\n",
+ "def is_prime_number(n):\n",
+ " if n < 2:\n",
+ " return False\n",
+ " for i in range(2, math.floor(math.sqrt(n))):\n",
+ " if n % i == 0:\n",
+ " return False\n",
+ " return True\n",
+ "\n",
+ "\n",
+ "def print_prime_number(n):\n",
+ " for i in range(1, n + 1):\n",
+ " if is_prime_number(i):\n",
+ " print(i)\n",
+ "\n",
+ "\n",
+ "print_prime_number(100)"
+ ],
+ "cell_type": "code",
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "2\n",
+ "3\n",
+ "4\n",
+ "5\n",
+ "6\n",
+ "7\n",
+ "8\n",
+ "9\n",
+ "11\n",
+ "13\n",
+ "15\n",
+ "17\n",
+ "19\n",
+ "23\n",
+ "25\n",
+ "29\n",
+ "31\n",
+ "35\n",
+ "37\n",
+ "41\n",
+ "43\n",
+ "47\n",
+ "49\n",
+ "53\n",
+ "59\n",
+ "61\n",
+ "67\n",
+ "71\n",
+ "73\n",
+ "79\n",
+ "83\n",
+ "89\n",
+ "97\n"
+ ]
+ }
+ ],
+ "execution_count": null
+ }
+ ]
+}
diff --git a/docs/01python/11practice/index.mdx b/docs/01python/11practice/index.mdx
new file mode 100644
index 000000000..2d2c7a6d8
--- /dev/null
+++ b/docs/01python/11practice/index.mdx
@@ -0,0 +1,68 @@
+---
+sidebar_position: 11
+---
+
+import ViewSource from "@site/src/components/ViewSource/ViewSource";
+import Answer from "@site/src/components/Answer";
+
+# 練習問題
+
+これまでの項で、Python についての基本的なことは学び終わったので、実際に様々な練習問題を解いていきましょう。
+
+## 練習問題 1
+
+Fizz Buzz 問題を解くプログラムを作ってみましょう。
+これは、プログラミング初心者向けの簡単な例題としてとても有名です。初歩的なプログラムを作成する能力があるのかを判定するためによく使われます。
+
+Fizz Buzz のルールは、次のようになっています。
+
+> プレイヤーは円状に座る。最初のプレイヤーは「1」と数字を発言する。次のプレイヤーは直前のプレイヤーの発言した数字に 1 を足した数字を発言していく。ただし、3 の倍数の場合は「Fizz」(Bizz Buzz の場合は「Bizz」)、5 の倍数の場合は「Buzz」、3 の倍数かつ 5 の倍数の場合(すなわち 15 の倍数の場合)は「Fizz Buzz」(Bizz Buzz の場合は「Bizz Buzz」)を数の代わりに発言しなければならない。発言を間違えた者や、ためらった者は脱落となる。
+> Wikipedia フリー百科事典 より
+
+$n$ 番目まで Fizz Buzz での正しい解を表示するプログラムを作ってみましょう。
+
+
+
+
+もう一つの有名な解法を見てみましょう。
+
+
+
+
+## 練習問題 2
+
+素数かどうかを判定する関数を作りましょう。さらに、この関数を使って $n$ 番目までの素数を表示する関数を作ってみましょう。実際に、`n = 100` として出力してみましょう。
+
+
+
+
+実は、$n$ が素数であるかを判定するのには、$\sqrt{n}$ までの自然数で割り切れるかを調べれば十分です。これは、もし $\sqrt{n}$ よりも大きい約数があってもその約数と対になる約数が存在してそれは $\sqrt{n}$ よりも小さくなるからです。よって、次のようにした方がより高速でしょう。
+
+
+
+
+
+## 練習問題 3
+
+素因数分解をする関数を作りましょう。
+
+
+
+
+
+## 練習問題 4
+
+最大公約数を求めるプログラムを作ってみましょう。最大公約数(greatest common divisor)は、GCD とよく略されます。
+
+
+
+
+再帰を使うと次のようにもできます。再帰は後の項で説明します。
+
+
+
+[`math` ライブラリの `gcd` 関数](https://docs.python.org/ja/3/library/math.html#math.gcd)を使っても計算できます。
+
+
+
+
diff --git a/docs/index.mdx b/docs/index.mdx
index 5b22a1063..773024bec 100644
--- a/docs/index.mdx
+++ b/docs/index.mdx
@@ -24,18 +24,20 @@ Python やアルゴリズムについて簡単にまとめていこうかなと
## 更新履歴
-11/13 第五週の分を執筆 [ライフゲーム](/docs/02advanced/01life-game)
+11/25 練習問題の項を執筆 [練習問題](/docs/01python/11practice/)
-11/6 第四週の分を執筆 [ここから](/docs/01python/09multi-array/)
+11/13 第五週の分を執筆 [ライフゲーム](/docs/02advanced/01life-game/)
+
+11/6 第四週の分を執筆 [多次元配列](/docs/01python/09multi-array/)、[条件分岐](/docs/01python/10if/)
11/6 range 関数についてを補足 [この下](/docs/01python/08array/#%E5%95%8F%E9%A1%8C-1)
-10/30 第三週の分を執筆 [ここから](/docs/01python/07for/)
+10/30 第三週の分を執筆 [繰り返し処理](/docs/01python/07for/)、[配列](/docs/01python/08array/)
-10/23 第二週の分を執筆 [ここから](/docs/01python/05function/)
+10/23 第二週の分を執筆 [関数](/docs/01python/05function/)、[ライブラリ](/docs/01python/06library/)
10/16 練習問題をさらに追加
10/10 練習問題を追加
-10/10 第一周の分を執筆 [ここから](/docs/01python/01google-colaboratory/)
+10/10 第一周の分を執筆 [環境構築](/docs/01python/01google-colaboratory/)、[はじめての Python](/docs/01python/02get-started/)、[式と演算子](/docs/01python/03expressions/)、[変数](/docs/01python/04variables/)