คำถามเกี่ยวกับโครงสร้างคำสั่ง if ใน Python

Quiz
•
Computers
•
10th Grade
•
Hard
Somphop Inyu
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
โครงสร้างพื้นฐานของคำสั่ง if ในภาษา Python มีรูปแบบการใช้งานอย่างไร?
if เงื่อนไข: # คำสั่งที่ต้องการให้ทำเมื่อเงื่อนไขเป็นจริง
if เงื่อนไข: # คำสั่งที่ต้องการให้ทำเมื่อเงื่อนไขเป็นเท็จ
if เงื่อนไข1: elif เงื่อนไข2: else:
if เงื่อนไข: # คำสั่งที่ต้องการให้ทำเมื่อเงื่อนไขเป็นจริง else: # คำสั่งที่ต้องการให้ทำเมื่อเงื่อนไขเป็นเท็จ
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
การเยื้องบรรทัด (Indentation) เป็นสิ่งสำคัญในการเขียนโค้ด Python เพราะ?
ช่วยให้โค้ดมีขอบเขตของบล็อคคำสั่ง
ช่วยให้โค้ดมีความยืดหยุ่น
เป็นการเพิ่มความสวยงามให้กับโค้ด
ช่วยให้โค้ดทำงานได้อย่างถูกต้อง
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
การใช้ : (Colon) หลังจากเงื่อนไขของคำสั่ง if, elif, และ else มีประโยชน์อย่างไร?
ช่วยให้โปรแกรมทำงานได้เร็วขึ้น
ช่วยให้โปรแกรมทำงานได้อย่างถูกต้อง
ช่วยให้โปรแกรมมีขอบเขตของบล็อคคำสั่ง
ช่วยให้โปรแกรมมีความยืดหยุ่น
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
การใช้เงื่อนไขที่เหมาะสมในคำสั่ง if จำเป็นต้องใช้อะไร?
Float
Boolean expression
Integer
String
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
ใน Python ใช้คำว่า elif แทนคำว่า?
Else or
Else
Else else
Else if
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
การใช้ else ในคำสั่ง if ทำให้โปรแกรมครอบคลุมกรณีใด?
กรณีที่เงื่อนไขเป็นเท็จ
กรณีที่เงื่อนไขไม่เป็นจริง
กรณีที่เงื่อนไขเป็นจริง
กรณีที่เงื่อนไขไม่เป็นเท็จ
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
การใช้หลายเงื่อนไขในคำสั่ง if สามารถใช้อะไรเพื่อรวมเงื่อนไข?
not
or
and
xor
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
คอมพิวเตอร์และสารสนเทศ

Quiz
•
10th - 12th Grade
12 questions
แบบทดสอบหลังเรียนหน่วยที่ 1

Quiz
•
10th Grade
15 questions
Python Basic

Quiz
•
10th Grade
10 questions
Microsoft เบื้องต้น

Quiz
•
10th Grade
10 questions
ผังงาน (Flowchart)

Quiz
•
10th Grade
12 questions
M41 4 ผังงาน (flow chart)

Quiz
•
4th - 10th Grade
10 questions
หน่วยที่ 2 การเขียนโปรแกรมเพื่อแก้ปัญหา ป 6

Quiz
•
1st - 12th Grade
10 questions
Pre-Test Excel

Quiz
•
10th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade