
Câu hỏi trắc nghiệm Python
Authored by Duy undefined
Others
KG
Used 10+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
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
STS SENI RUPA
Quiz
•
4th Grade
46 questions
Môn sử
Quiz
•
11th Grade
50 questions
đề cương địa hk 1 (trắc nghiệm)
Quiz
•
1st Grade
45 questions
sử ck1
Quiz
•
1st Grade
50 questions
SUMATIF TENGAH SEMESTER 1 KELAS XI (GANJIL-2024/2025)
Quiz
•
11th Grade
50 questions
Grade 1 Biweekly Assessment (2.0)
Quiz
•
1st Grade
50 questions
QPAN2 71-120
Quiz
•
KG
50 questions
Advanced Statistics
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Others
20 questions
Place Value
Quiz
•
KG - 3rd Grade
6 questions
3.3 Magnets
Quiz
•
KG
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University
12 questions
HOMOPHONES
Lesson
•
KG - 4th Grade
10 questions
Long i- igh, ie, and y Quiz
Quiz
•
KG - 3rd Grade
12 questions
Quarter Past, Half Past, and Quarter To
Quiz
•
KG - 12th Grade
20 questions
Capitalization in sentences
Quiz
•
KG - 4th Grade
14 questions
Reference Sources
Lesson
•
KG - 3rd Grade