Skip to content

Commit

Permalink
Implement zero-counting function in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
mickythegeek committed Jan 29, 2024
1 parent fa75741 commit 4f23891
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mickythegeek/count_zeros.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def CountZeros(A=[]):
arr_of_zeros = []
for i in A:
if i == 0:
arr_of_zeros.append(i)

return len(arr_of_zeros)


print(CountZeros([88,0,0,0,0,0,0,0,0,6,5,4,3,2,6,6,8,8,89,9,6]))

0 comments on commit 4f23891

Please sign in to comment.