Skip to content · ⁨Bỏ qua nội dung⁩

Count a value · ⁨Đếm một giá trị⁩

English

Count a value

Count how often one value appears in a list.

Loop over the list and compare each item with target. It is the counter pattern again, with the condition item == target, and it works for words as well as numbers.

Tiếng Việt

Đếm số lần xuất hiện của một giá trị

Đếm xem một giá trị xuất hiện bao nhiêu lần trong danh sách.

Duyệt qua danh sách và so sánh từng phần tử với target. Đây lại là mẫu bộ đếm, với điều kiện item == target, và nó hoạt động tốt cho cả từ ngữ lẫn số.

Log in or create account · ⁨Đăng nhập hoặc tạo tài khoản⁩

IGCSE, A-Level & AP