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