
Cấu trúc rẽ nhánh trong Python
Quiz
•
Computers
•
10th Grade
•
Practice Problem
•
Medium
Phan HPG)
Used 4+ times
FREE Resource
Enhance your content in a minute
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu lệnh if trong Python được sử dụng để làm gì?
Kiểm tra điều kiện và thực thi khối lệnh nếu điều kiện đúng.
Kết thúc chương trình ngay lập tức.
Tạo ra một biến mới trong Python.
Thực hiện vòng lặp qua các phần tử.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cú pháp của câu lệnh if-else trong Python là gì?
if condition: # code to execute if condition is true else: # code to execute if condition is false
if condition then: # code to execute if condition is true else: # code to execute if condition is false
if (condition) { # code to execute if condition is true } else { # code to execute if condition is false }
if condition: # code to execute if condition is false else: # code to execute if condition is true
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Biểu thức điều kiện trong câu lệnh if phải trả về kiểu dữ liệu nào?
float
boolean
string
integer
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Khi nào thì câu lệnh else được thực thi?
Khi điều kiện trong câu lệnh if không được thỏa mãn.
Khi điều kiện trong câu lệnh if được thỏa mãn.
Khi chương trình kết thúc.
Khi câu lệnh if không tồn tại.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu lệnh if có thể lồng nhau không?
Chỉ có thể lồng if với else.
Không, câu lệnh if không thể lồng nhau.
Câu lệnh if chỉ có thể sử dụng một lần.
Có, câu lệnh if có thể lồng nhau.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cú pháp của câu lệnh if-elif-else là gì?
if điều_kiện: // kiểm tra
if điều_kiện: // thực hiện ngay
if điều_kiện: // thực hiện elif điều_kiện: // thực hiện else: // thực hiện
if điều_kiện: // không thực hiện
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Khi nào thì câu lệnh elif được sử dụng?
Khi không cần sử dụng cấu trúc điều kiện.
Khi muốn kết thúc chương trình ngay lập tức.
Khi chỉ cần kiểm tra một điều kiện đơn giản.
Khi cần kiểm tra nhiều điều kiện trong cấu trúc điều kiện.
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
15 questions
Sinh hoạt lớp Tuần 7
Quiz
•
1st Grade - University
16 questions
Python Basics
Quiz
•
KG - University
17 questions
"switch" Java Statement - 1
Quiz
•
9th - 10th Grade
10 questions
Bài 25 tin 10
Quiz
•
9th Grade - University
10 questions
Google Docs - Tables
Quiz
•
9th - 10th Grade
14 questions
Kiểu dữ liệu xâu kí tự - xử lí xâu kí tự
Quiz
•
9th - 12th Grade
15 questions
Lua Review Corona SDK with Notepad++
Quiz
•
10th - 12th Grade
10 questions
STM BTEC DIT 3- 5. Maintenance, set-up, performance p152
Quiz
•
9th - 11th Grade
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for Computers
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
18 questions
Thanksgiving Trivia
Quiz
•
4th - 12th Grade
20 questions
Thanksgiving
Quiz
•
KG - 12th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
10 questions
Thanksgiving Trivia Challenge: Test Your Knowledge!
Interactive video
•
6th - 10th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
