このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
English
A program runs in order
- A program is a list of steps.
- Python runs them from top to bottom, one at a time.
- This order is called sequence — the first idea in the syllabus.

English
print("Wake up")
print("Brush teeth")
print("Go to school")
English
OUTPUT becomes print()
- In the exam, OUTPUT shows something on the screen.
- In Python, that is
print(). - The text inside the quotes is printed, then a new line starts.
English
print("Hello, world!")
print("IGCSE Computer Science")
English
INPUT becomes input()
- In the exam, INPUT reads what the user types.
- In Python, that is
input(). - It always gives back a string (text), even if the user types digits.
English
name = input()
print("Hello, " + name)
English
Turn input into a number
input()gives text, so"5"is not the number 5.- Wrap it with
int()to get a whole number. - Now you can do maths with it.
English
age = int(input())
print(age + 1)
English
In the exam: pseudocode
- The same idea in Cambridge pseudocode uses
INPUTandOUTPUT.
OUTPUT "What is your name?"
INPUT Name
OUTPUT "Hello, ", Name
English
Common mistakes
- Statements run from top to bottom, in the order you write them.
input()gives back text (a string); useint(...)when you need a number.
English
Now you try
- Use
print()to show output. - Use
input()to read a line — leave the brackets empty here. - Press Check answer to test your code.
探索
入力 → 処理 → 出力
ほとんどのプログラムは以下の形式に従います:入力を受け取って、処理を行い、出力を表示する。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
これら3行を順序通り出力してください:Ready、次にSet、最後にGo — 各行に1つずつ。
実行ボタンをクリックして出力を確認してください。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
input()で名前を読み込み、次にHello, 、その後名前の後、!を出力してください。入力Samに対しては、出力がHello, Sam!になるはずです。
実行ボタンをクリックして出力を確認してください。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
input() で整数を読み込み、int(...) で変換し、倍(×2)して出力してください。入力 6 に対しては、出力 12 となるはずです。
実行ボタンをクリックして出力を確認してください。