Skip to content

Count a value

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.

Log in or create account

IGCSE, A-Level & AP