Search Header Logo

การเขียนโปรแกรมเชิงวัตถุ (Python) 6-10

Authored by Arkom Rungsawang

others

Used 1+ times

การเขียนโปรแกรมเชิงวัตถุ (Python) 6-10
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

ข้อใดเป็นโครงสร้างคำสั่ง if ที่ถูกต้องใน Python?

if x == 10 then:
if x == 10:
if (x == 10) {
if x == 10: end if

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

คำสั่งใดใช้สำหรับตรวจสอบว่าตัวแปร x มีค่ามากกว่า 5 และน้อยกว่า 10?

if x > 5 and x < 10:
if x > 5 or x < 10:
if x => 5 && x <= 10:
if x = 5 to 10:

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

ข้อใดเป็นเงื่อนไขที่ใช้ตรวจสอบว่าตัวแปร x มีค่าเป็นเลขคู่?

if x % 2 = 0:
if x // 2 == 0:
if x % 2 == 0:
if x / 2 == 0:

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

คำสั่งใดใช้สำหรับตรวจสอบว่าค่า x เป็น None หรือไม่?

if x = None:
if x == None:
if x isEqual None:
if x.equals(None):

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

ถ้าใช้ if not x: หมายถึงอะไร?

ตรวจสอบว่า x มีค่ามากกว่า 0
ตรวจสอบว่า x เป็น True
ตรวจสอบว่า x ไม่มีค่า หรือเป็น False
ตรวจสอบว่า x เป็น None เท่านั้น

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

ข้อใดผิดเกี่ยวกับ if

if สามารถใช้ร่วมกับ else
if ต้องมี elif เสมอ
if สามารถใช้ซ้อนกันได้
if ต้องมี : หลังเงื่อนไข

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

ข้อใดเป็นรูปแบบที่ถูกต้องของคำสั่ง if ใน Python?

if condition {}
if condition:
if (condition):
if: condition

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?