Skip to content
CodeItRaw
Code Reading
/
First Negative
Path
Play
Daily
Leaderboard
tr
Break the Code
First Negative
Write a list for which this function gives the wrong answer.
1
def
first_negative
(values):
2
for
i
in
range
(
1
,
len
(values)):
3
if
values[i] <
0
:
4
return
i
5
return
-
1