ทดสอบความรู้ในการสร้างและเรียกใช้ฟังก์ชันใน Python

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

ฟังก์ชันคืออะไร?

  • คำสั่งที่ใช้ส่งค่ากลับจากฟังก์ชัน
  • กลุ่มคำสั่งที่รวมตัวอยู่ภายใต้ชื่อเรียกหนึ่ง (correct)
  • กลุ่มคำสั่งที่ทำงานเมื่อถูกเรียกเท่านั้น
  • ตัวแปรที่อยู่ในวงเล็บของฟังก์ชัน

การส่งค่าให้ฟังก์ชันสามารถทำได้ผ่านอะไร?

  • Return ของฟังก์ชัน
  • Parameter ของฟังก์ชัน (correct)
  • คำสั่งในวงเล็บของฟังก์ชัน
  • ชื่อฟังก์ชัน

Parameter ของฟังก์ชันคืออะไร?

  • คำสั่งที่ใช้ส่งค่ากลับจากฟังก์ชัน
  • ตัวแปรที่อยู่ในวงเล็บของฟังก์ชัน (correct)
  • กลุ่มคำสั่งที่ทำงานเมื่อถูกเรียกเท่านั้น
  • กลุ่มคำสั่งที่รวมตัวอยู่ภายใต้ชื่อเรียกหนึ่ง

ฟังก์ชันส่งค่ากลับมาได้ผ่านคำสั่งใด?

<p>return (A)</p> Signup and view all the answers

ตอนเรียกฟังก์ชันจะต้องใส่อะไรให้ครบตามที่ฟังก์ชันกำหนด?

<p>Parameter (C)</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

ฟังก์ชัน

  • ฟังก์ชันคือการดำเนินการบางอย่างที่สามารถเรียกใช้ซ้ำได้และได้รับค่ากลับมา

การส่งค่าให้ฟังก์ชัน

  • สามารถส่งค่าให้ฟังก์ชันผ่าน parameter ได้

Parameter ของฟังก์ชัน

  • คือค่า input ที่ส่งให้ฟังก์ชันเพื่อใช้ในการคำนวณหรือดำเนินการบางอย่าง

การส่งค่ากลับมาจากฟังก์ชัน

  • ฟังก์ชันสามารถส่งค่ากลับมาได้โดยใช้คำสั่ง return

การเรียกฟังก์ชัน

  • ต้องใส่ parameter ให้ครบตามที่ฟังกนที่กำหนดไว้เพื่อหลีกเลี่ยงข้อผิดพลาด

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

Use Quizgecko on...
Browser
Browser