Skip to content
CodeItRaw
Code Reading
/
Count the Negatives
Path
Play
Daily
Leaderboard
tr
Break the Code
Count the Negatives
Write a list for which this function gives the wrong answer.
1
def
count_negatives
(values):
2
count =
0
3
for
v
in
values:
4
if
v <=
0
:
5
count +=
1
6
return
count