Run it! · 実行!
Start here
- A lesson is a list of short steps. Press Continue (the arrow at the bottom) for the next one.
- After the steps come tasks: code you change and run.
- Today you type very little. You change one small thing at a time.
ここから始めます
- レッスンとは短い手順のリストです。次へ(下部の矢印)を押して次の手順に進みます。
- 手順の後にタスクがあります:コードを変えて実行する部分です。
- 今日はほとんど入力しません。少しずつ小さな変更を加えます。
The buttons
- Run ▶ runs the code. What it prints appears in the dark box under it.
- Check answer tests your code. Green means correct, and you win coins.
- The lightbulb gives a hint when you are stuck.
- Reset brings the starting code back.
ボタンの使い方
- 実行 ▶ がコードを実行します。出力は下にある暗いボックスに表示されます。
- 正解確認 はコードをチェックします。緑色なら正解で、コインが手に入ります。
- 電球 は詰まった時にヒントを提供します。
- リセット は初期のコードに戻します。
print("I am an example. Press the play button to run me.")
When something goes wrong
- If the code has a mistake, Python stops and shows red text.
- Under the red text, a card explains the error in English and Chinese and tells you which line to look at.
- Mistakes are normal. Read the card, fix one thing, and run again.
エラーが発生した時
- コードに誤りがある場合、Python は停止して赤いテキストを表示します。
- 赤いテキストの下にあるカードで、エラーの内容が英語と中国語で説明され、確認すべき行番号も示されます。
- エラーは正常なプロセスです。カードを読み、一つ修正してから再度実行してください。
When a program waits for you
- Some programs ask a question with
input(). - Then a highlighted box appears: type here, then press Enter.
- Click the box, type your answer and press Enter. The program continues.
プログラムが入力を待っている時
- 一部のプログラムは
input()を使って質問をします。 - その後、ハイライトされたボックスが表示されます:ここにタイプし、Enterキーを押してください。
- ボックスをクリックして答えを入力し、Enterキーを押します。そうするとプログラムは続行します。
name = input("What is your name? ")
print("Nice to meet you, " + name)
Now you try
- Three small tasks. Change the code, press Run, then Check answer.
あなたも試してみよう
- 3つの小タスクです。コードを変更し、実行 を押し、次に正解確認 を押してください。
This program is switched off: the # at the start makes the line a comment, so Python skips it. Delete the #, press Run ▶ to see what it prints, then press Check answer. · このプログラムはオフになっています:冒頭の # が行をコメントにするため、Python はそれをスキップします。 # を削除し、Run ▶ を押して出力を確認した後、Check answer を押してください。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
Change one word so the program prints I like dogs. Only the text inside the quotes changes. · 1つの単語を変えて、プログラムが I like dogs を出力するようにしてください。引用符内のテキストのみが変わります。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。
This program has a mistake. Press Run ▶ first and read the card under the red text: it explains the error. Then fix the line so the program prints Hello. · このプログラムにミスがあります。まず Run ▶ を押し、赤いテキスト下のカードを読んでエラーの説明を確認してください。その後、プログラムが Hello を出力するようその行を修正してください。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。