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

Quiz
•
Science
•
10th Grade
•
Hard
Nguyễn Tâm
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
10 questions
KHỐI 10 MIỆNG HK2 (L1)

Quiz
•
10th Grade
10 questions
BÀI TẬP CHƯƠNG I, II

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

Quiz
•
10th Grade
9 questions
Quiz Thuật toán

Quiz
•
9th - 12th Grade
15 questions
KIỂM TRA 15P HK2 LẦN 1

Quiz
•
10th Grade - University
11 questions
SB18 CP1

Quiz
•
4th Grade - University
10 questions
Python_HW6

Quiz
•
6th Grade - University
15 questions
ôn tập kiến thức lập trình trong CodeCombat

Quiz
•
3rd - 12th Grade
Popular Resources on Wayground
12 questions
Unit Zero lesson 2 cafeteria

Lesson
•
9th - 12th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
20 questions
Lab Safety and Equipment

Quiz
•
8th Grade
13 questions
25-26 Behavior Expectations Matrix

Quiz
•
9th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Science
17 questions
Lab Safety

Interactive video
•
10th Grade
10 questions
Lab Safety Essentials

Interactive video
•
6th - 10th Grade
10 questions
Exploring Types of Matter: Elements, Compounds, and Mixtures

Interactive video
•
6th - 10th Grade
10 questions
Exploring the Scientific Method

Interactive video
•
6th - 10th Grade
12 questions
Lab Safety

Quiz
•
6th - 12th Grade
13 questions
Amoeba Sisters: Biomolecules

Interactive video
•
9th - 12th Grade
10 questions
Exploring Latitude and Longitude Concepts

Interactive video
•
6th - 10th Grade
20 questions
Reading Graphs in Science

Quiz
•
9th - 12th Grade