Count the positives
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Count the positives
Return how many numbers in a list are greater than 0. Zero itself does not count.
A counter starts at 0 and grows by 1 each time the condition is true.
Write count_positive(nums) that returns how many numbers in the list are greater than 0.
Click Run to see the output here.