Use what it gives back · 戻り値を使う
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
This one builds on a lesson you haven't finished yet. Do that lesson first: · これはまだ完了していないレッスンの先にある内容です。まずはそのレッスンを済ませてください:
Python Basics · Functions →
English
Use what it gives back
double is written for you and returns a number. Call it with 21 and store the answer in answer.
return hands a value back to whoever called the function. That value is not printed — you catch it with =, exactly like any other result.
日本語
戻り値を使う
doubleはすでに書かれており、数字を返します。21を引数として呼び出し、答えをanswerに格納します。
returnは関数を呼び出した側へ値を返します。その値は直接表示されませんが、=で受け取ります。他の結果と同じように扱います。
double is written for you and returns a number. Call it with 21 and store the answer in answer. · doubleはすでに書かれており、数字を返します。21を引数として呼び出し、答えをanswerに格納します。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。