
การเขียนโปรแกรมแบบมีทางเลือกคำสั่ง if
Quiz
•
Computers
•
9th Grade
•
Practice Problem
•
Hard
อัจฉรา เป็ดทอง
Used 5+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1. คำสั่ง if ในภาษาไพทอนใช้เพื่ออะไร?
ใช้เพื่อสร้างฟังก์ชันใหม่
ใช้เพื่อตรวจสอบเงื่อนไขและดำเนินการตามเงื่อนไขนั้น
ใช้เพื่อจัดการกับข้อผิดพลาด
ใช้เพื่อทำซ้ำคำสั่งหลายครั้ง
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
2. คำสั่ง if แบบง่ายมีรูปแบบอย่างไร?
if (เงื่อนไข) : // คำสั่ง
if (เงื่อนไข) { // คำสั่ง }
if (เงื่อนไข) // คำสั่ง
if { // คำสั่ง } (เงื่อนไข)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
3. ถ้า x = 10, y = 5, คำสั่ง if ต่อไปนี้จะให้ผลลัพธ์อะไร: if x > y: print('x มากกว่า y')?
y มากกว่า x
x เท่ากับ y
x มากกว่า y
x น้อยกว่า y
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
4. คำสั่ง if-else ใช้เมื่อใด?
เมื่อมีการตัดสินใจตามเงื่อนไข
เมื่อใช้ฟังก์ชันเฉพาะ
เมื่อทำซ้ำคำสั่ง
เมื่อไม่มีเงื่อนไข
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
5. ถ้า a = 3, b = 3, คำสั่ง if-else ต่อไปนี้จะให้ผลลัพธ์อะไร: if a < b: print('a น้อยกว่า b') else: print('a เท่ากับหรือมากกว่า b')?
a มากกว่า b
a น้อยกว่า b
a เท่ากับหรือมากกว่า b
a เท่ากับ b
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
6. การใช้ if-elif-else มีประโยชน์อย่างไร?
ช่วยให้จัดการเงื่อนไขหลายๆ เงื่อนไขได้อย่างมีระเบียบและชัดเจน
ลดความซับซ้อนของโค้ด
ทำให้โปรแกรมทำงานช้าลง
ช่วยให้เขียนโค้ดได้เร็วขึ้น
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
7. ถ้า x = 7, y = 10, คำสั่ง if-elif-else ต่อไปนี้จะให้ผลลัพธ์อะไร: if x > y: print('x มากกว่า y') elif x < y: print('x น้อยกว่า y') else: print('x เท่ากับ y')?
x เท่ากับ y
x มากกว่า y
y น้อยกว่า x
x น้อยกว่า y
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
30 questions
ทดสอบหลักเศรษฐศาสตร์ครั้งที่ 1
Quiz
•
9th - 12th Grade
25 questions
ม.3 02 ข้อสอบก่อนเรียน วิทยาการคำนวณ
Quiz
•
9th Grade
25 questions
การสร้างเว็บแอพ
Quiz
•
9th - 12th Grade
26 questions
Digital Literacy
Quiz
•
7th - 12th Grade
35 questions
ทบทวน scratch
Quiz
•
9th - 12th Grade
30 questions
คอมพิวเตอร์ ม.1
Quiz
•
9th Grade
30 questions
เกมส์รู้ทันโลกออนไลน์
Quiz
•
9th - 12th Grade
30 questions
แบบทดสอบหลังเรีบน เรื่องตรรกศาสตร์
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
