Nine Counter

Lists often need a count of one specific value, such as a score, error code, or target number. Write a function array_count9 that takes a list of numbers nums and returns how many elements are equal to 9. Go through the list and increase the counter each time you find a nine.

Примеры

Ввод
[1, 2, 9]
Вывод
1
Ввод
[1, 9, 9]
Вывод
2
Ввод
[1, 9, 9, 3, 9]
Вывод
3

Нужно реализовать

def array_count9(nums: list[int]) -> int:

Теги

listsarray
PostgreSQLv16

Aquí aparecerá el resultado de la ejecución del código

Visible tests
1
Input
[1,2,9]
Expected1
2
Input
[1,9,9]
Expected2
3
Input
[1,9,9,3,9]
Expected3
4
Input
[]
Expected0
5
Input
[1,2,3]
Expected0
6
Input
[2,10,10]
Expected0
Focus radio
Paused · SomaFM · Fluid