Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Procedures & functions · ⁨กระบวนการและฟังก์ชัน⁩

English

A function is a named block

  • A function is a named block of code you can run again and again.
  • Define it once with def, then call it by name.
  • This avoids repeating yourself and keeps programs tidy.
ไทย

ฟังก์ชันคือบล็อกที่มีชื่อ

  • ฟังก์ชัน คือบล็อกโค้ดที่มีชื่อ ซึ่งคุณสามารถเรียกใช้งานได้ซ้ำๆ
  • กำหนดไว้ครั้งเดียวด้วย def แล้ว เรียกใช้ โดยชื่อ
  • สิ่งนี้ช่วยหลีกเลี่ยงการซ้ำซ้อนและทำให้โปรแกรมเป็นระเบียบ

Handout · ⁨เอกสารประกอบการเรียน⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP