Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/python/expressions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sidebar_position: 3
---

import ViewSource from "@site/src/components/ViewSource/ViewSource";
import Answer from "@site/src/components/Answer";

# 式と演算子

Expand Down Expand Up @@ -43,7 +44,6 @@ Python では様々な計算ができます。

球の体積( $\frac{4}{3}\pi r^3$ )を求めてみましょう。$\pi=3.14, r=2$ とします。

<details>
<summary>解答</summary>
<Answer>
<ViewSource path="_samples/cube.ipynb" />
</details>
</Answer>
6 changes: 3 additions & 3 deletions docs/python/get-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sidebar_position: 2
---

import ViewSource from "@site/src/components/ViewSource/ViewSource";
import Answer from "@site/src/components/Answer";

# はじめての Python

Expand All @@ -22,10 +23,9 @@ import ViewSource from "@site/src/components/ViewSource/ViewSource";

`Hello from Python!` と出力するようなプログラムを書いてみましょう。

<details>
<summary>解答</summary>
<Answer>
<ViewSource path="_samples/hello-from-python.ipynb" />
</details>
</Answer>

## コメント

Expand Down
6 changes: 3 additions & 3 deletions docs/python/variables/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sidebar_position: 4
---

import ViewSource from "@site/src/components/ViewSource/ViewSource";
import Answer from "@site/src/components/Answer";

# 変数

Expand Down Expand Up @@ -35,7 +36,6 @@ Python では定数は使えないようです。慣習的に定数は大文字

[式と演算子の項](/docs/python/expressions/#問題)の問題を変数を使って解いてみましょう。

<details>
<summary>解答</summary>
<Answer>
<ViewSource path="_samples/cube.ipynb" />
</details>
</Answer>
9 changes: 9 additions & 0 deletions src/components/Answer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";
import Details from "@theme/Details";

/**
* 解答を書くための、コンポーネント
*/
export default function Answer({ children }) {
return <Details summary={<summary>解答</summary>}>{children}</Details>;
}