Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

first index of an integer less than a value

value = int(input())
alist = list(map(int, input().split()))
res = next(x for x, val in enumerate(test_list)
                                  if val < value)

print ("The index of element just greater than 0.6 : "
                                           + str(res))
 
PREVIOUS NEXT
Tagged: #index #integer
ADD COMMENT
Topic
Name
6+5 =