Skip to content · ⁨コンテンツへスキップ⁩

Call a function · ⁨関数を呼び出す⁩

English

Call a function

greet is already written for you. Call it with "Mia" so the program prints "Hello, Mia".

Writing def only describes the function — nothing happens until you call it by name with brackets: greet("Mia"). The call goes at the left margin, outside the def.

日本語

関数を呼び出す

greetはすでに書かれています。"Mia"を引数として呼び出し、プログラムが"Hello, Mia"を出力するようにします。

defを書くことは関数を定義するだけで、括弧付きの名前での呼び出しをするまで何も起きません:greet("Mia")。呼び出しはdefの外側、左端の位置に行います。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP