To solve the
CodePudding user response:
[x & lt; 0 for x in a]. Index (True)CodePudding user response:
For I, x enumerate in (a) :If x & lt; 0:
Return the I
CodePudding user response:
Your function x=0; A=[], so does not meet the conditions of the while loop the start 0 & lt; Len (a), inside a is emptyCodePudding user response:
> A[2, 3, 1, 4, 2)
> B
[2, 3, 1, 4, 2)
> Index_num [0] the if (index_num:=[index for the index, I enumerate in (a) if i<0]) else None
2
> Index_num [0] the if (index_num:=[index for the index, I enumerate in (b) if i<0]) else None
>