diff --git a/IWANDETO/count_zeros.py b/IWANDETO/count_zeros.py new file mode 100644 index 00000000..f7989207 --- /dev/null +++ b/IWANDETO/count_zeros.py @@ -0,0 +1,10 @@ +#!/usr/bin/python3 +def CountZeros(array): + counter = 0 #Initializing count to zero + for x in array: + if x == 0: + counter += 1 + return counter + +test = CountZeros([1, 4, 5, 6, 0, 2]) +print(test) \ No newline at end of file