File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ sidebar_position: 3
3
3
---
4
4
5
5
import ViewSource from " @site/src/components/ViewSource/ViewSource" ;
6
+ import Answer from " @site/src/components/Answer" ;
6
7
7
8
# 式と演算子
8
9
@@ -43,7 +44,6 @@ Python では様々な計算ができます。
43
44
44
45
球の体積( $\frac{ 4 }{ 3 } \pi r^3$ )を求めてみましょう。$\pi=3.14, r=2$ とします。
45
46
46
- <details >
47
- <summary >解答</summary >
47
+ <Answer >
48
48
<ViewSource path = " _samples/cube.ipynb" />
49
- </details >
49
+ </Answer >
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ sidebar_position: 2
3
3
---
4
4
5
5
import ViewSource from " @site/src/components/ViewSource/ViewSource" ;
6
+ import Answer from " @site/src/components/Answer" ;
6
7
7
8
# はじめての Python
8
9
@@ -22,10 +23,9 @@ import ViewSource from "@site/src/components/ViewSource/ViewSource";
22
23
23
24
` Hello from Python! ` と出力するようなプログラムを書いてみましょう。
24
25
25
- <details >
26
- <summary >解答</summary >
26
+ <Answer >
27
27
<ViewSource path = " _samples/hello-from-python.ipynb" />
28
- </details >
28
+ </Answer >
29
29
30
30
## コメント
31
31
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ sidebar_position: 4
3
3
---
4
4
5
5
import ViewSource from " @site/src/components/ViewSource/ViewSource" ;
6
+ import Answer from " @site/src/components/Answer" ;
6
7
7
8
# 変数
8
9
@@ -35,7 +36,6 @@ Python では定数は使えないようです。慣習的に定数は大文字
35
36
36
37
[ 式と演算子の項] ( /docs/python/expressions/#問題 ) の問題を変数を使って解いてみましょう。
37
38
38
- <details >
39
- <summary >解答</summary >
39
+ <Answer >
40
40
<ViewSource path = " _samples/cube.ipynb" />
41
- </details >
41
+ </Answer >
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+ import Details from "@theme/Details" ;
3
+
4
+ /**
5
+ * 解答を書くための、コンポーネント
6
+ */
7
+ export default function Answer ( { children } ) {
8
+ return < Details summary = { < summary > 解答</ summary > } > { children } </ Details > ;
9
+ }
You can’t perform that action at this time.
0 commit comments