Skip to content · ⁨Bỏ qua nội dung⁩

Call a function · ⁨Gọi một hàm⁩

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.

Tiếng Việt

Gọi một hàm

greet đã được viết sẵn cho bạn. Gọi nó với "Mia" để chương trình in ra "Hello, Mia".

Viết def chỉ mô tả hàm — không có gì xảy ra cho đến khi bạn gọi nó bằng tên kèm theo dấu ngoặc: greet("Mia"). Lời gọi nằm ở lề trái, bên ngoài def.

Log in or create account · ⁨Đăng nhập hoặc tạo tài khoản⁩

IGCSE, A-Level & AP