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

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

10th Grade

10 Qs

quiz-placeholder

Similar activities

Life of Jesus

Life of Jesus

KG - University

14 Qs

TẠO LẬP THẾ GIỚI (THẦN THOẠI) SÁCH NGỮ VĂN CTST LỚP 10

TẠO LẬP THẾ GIỚI (THẦN THOẠI) SÁCH NGỮ VĂN CTST LỚP 10

10th Grade

15 Qs

Exploring Family Studies

Exploring Family Studies

KG - University

14 Qs

TƯ VẤN GIỎI LÀ ĐẶT CÂU HỎI HAY

TƯ VẤN GIỎI LÀ ĐẶT CÂU HỎI HAY

1st - 10th Grade

10 Qs

With Dorabase, let's bring back your memories!

With Dorabase, let's bring back your memories!

1st Grade - University

15 Qs

Scene and Victim Survey

Scene and Victim Survey

7th - 10th Grade

15 Qs

Minigame Nâng cao năng lực TPP Quý 1.2025

Minigame Nâng cao năng lực TPP Quý 1.2025

10th Grade

11 Qs

Triết học_Buổi 13

Triết học_Buổi 13

1st - 10th Grade

10 Qs

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

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

Assessment

Quiz

Other

10th Grade

Practice Problem

Hard

Created by

Nguyễn Trang

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?