
Cấu Trúc Vòng Lặp While

Quiz
•
Science
•
10th Grade
•
Hard
Nguyễn Tâm
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu lệnh `while` dùng để làm gì trong lập trình?
Thực hiện một lần duy nhất đoạn mã
Lặp đoạn mã một số lần xác định
Lặp đoạn mã khi điều kiện còn đúng
Ngắt chương trình
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong Python, cú pháp của vòng lặp `while` là gì?
while (condition) { statements }
while: condition { statements }
while condition:
while = condition:
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Vòng lặp `while` kết thúc khi nào?
Khi hết bộ nhớ
Khi điều kiện sai
Khi người dùng nhập số 0
Khi chương trình dừng đột ngột
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đoạn mã sau thực hiện điều gì? x = 1; while x < 5: print(x); x += 1
In ra các số từ 0 đến 5
In ra các số từ 1 đến 4
In ra các số từ 1 đến 5
Vòng lặp vô hạn
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Vì sao cần tăng biến `x` trong vòng lặp `while`?
Để giảm tốc độ chương trình
Để tránh lặp vô hạn
Để in ra chữ cái
Để kiểm tra cú pháp
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Khi sử dụng `while`, nếu điều kiện ban đầu là `False` thì:
Vòng lặp sẽ không thực hiện lần nào
Vòng lặp vẫn thực hiện 1 lần
Lỗi cú pháp xảy ra
Máy tính treo
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Chọn đoạn mã đúng để tính tổng từ 1 đến 5:
sum = 0; i = 1; while i < 6: sum += i; i += 1
sum = 0; i = 1; while i <= 5: i += 1; sum += i
sum = 0; i = 1; while i <= 5: sum += i
sum = 0; i = 1; while i <= 5: sum += i; i += 1
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Symbiotic relationships

Quiz
•
7th Grade - University
10 questions
Phần 1: ôn tập phần thiết kế và công nghệ lớp 10

Quiz
•
10th Grade
12 questions
Bài 43 KHTN 6

Quiz
•
1st - 11th Grade
11 questions
Nhóm lửa - Bóng Đèn's 1st Meeting

Quiz
•
10th Grade - Professi...
10 questions
Evaluasi Struktur Kontrol Perulangan C++

Quiz
•
10th Grade
15 questions
Use to When and While

Quiz
•
8th Grade - University
15 questions
bài 3

Quiz
•
10th Grade
15 questions
Observation and Hypothesis

Quiz
•
7th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Science
10 questions
Exploring the Scientific Method

Interactive video
•
6th - 10th Grade
10 questions
Exploring Chemical and Physical Changes

Interactive video
•
6th - 10th Grade
10 questions
Exploring Newton's Laws of Motion

Interactive video
•
6th - 10th Grade
10 questions
Exploring Metals, Nonmetals, and Metalloids

Interactive video
•
6th - 10th Grade
20 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
10 questions
Exploring Earth's Spheres and Their Interactions

Interactive video
•
6th - 10th Grade
10 questions
Exploring the Periodic Table

Interactive video
•
6th - 10th Grade
10 questions
Exploring Atoms, Elements, Molecules, and Compounds

Interactive video
•
6th - 10th Grade