
Câu hỏi trắc nghiệm Python
Quiz
•
Others
•
KG
•
Practice Problem
•
Easy
Duy undefined
Used 10+ times
FREE Resource
Enhance your content in a minute
47 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong Python, cách khai báo biến nào sau đây là đúng?
int x = 10
x : int = 10
x = 10
int x <- 10
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Lệnh nào được sử dụng để in ra màn hình trong Python?
print()
output()
write()
display()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu lệnh nào sau đây là đúng cú pháp của lệnh rẽ nhánh trong Python?
if x > 5 print("x lớn hơn 5")
if x > 5: print("x lớn hơn 5")
if (x > 5) { print("x lớn hơn 5") }
if x > 5 then print("x lớn hơn 5")
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Lệnh lặp for trong Python được sử dụng để làm gì?
Tạo điều kiện rẽ nhánh.
Lặp lại một khối lệnh theo số lần cố định hoặc duyệt qua các phần tử.
Gán giá trị cho biến.
Kết thúc chương trình.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Kết quả của đoạn mã sau là gì? for i in range(3): print(i)
1 2 3
0 1 2
1 2
Lỗi.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Sửa lỗi trong đoạn mã sau để in ra tổng các số từ 1 đến 100: total = 0 for i in range(1, 100): total += i print(total)
Thay range(1, 100) bằng range(1, 101).
Thay total += i bằng total = i.
Thay print(total) bằng return total.
Thêm if i < 100: vào vòng lặp.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Để tránh vòng lặp vô hạn trong lệnh while, chúng ta cần:
Sử dụng hàm break.
Đảm bảo điều kiện của vòng lặp trở thành sai tại một thời điểm nào đó.
Sử dụng từ khóa continue.
Sử dụng vòng lặp for.
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
45 questions
Manual AAA
Quiz
•
KG - University
47 questions
Pelajaran Agama Islam
Quiz
•
1st - 5th Grade
52 questions
LS
Quiz
•
KG
50 questions
educacion para la salud
Quiz
•
1st Grade
48 questions
địa hk2 48 câu
Quiz
•
2nd Grade
44 questions
Kuis PAT 2023
Quiz
•
KG - University
43 questions
General Physics 1 8-12
Quiz
•
12th Grade
50 questions
TECHTOK CHAMPS (PENYISIHAN)
Quiz
•
6th - 8th 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
Discover more resources for Others
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
20 questions
Disney Characters
Quiz
•
KG
10 questions
Christmas/Winter
Quiz
•
KG - 2nd Grade
10 questions
Christmas Characters
Quiz
•
KG - 3rd Grade
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Place Value
Quiz
•
KG - 3rd Grade
10 questions
Christmas Movies
Quiz
•
KG - 12th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
KG - 3rd Grade
