Sobes.tech
Intern — Middle

Determining the position of a given number in a sorted array

livecode

Task condition

It is necessary to implement a function that takes a sorted list of numbers and a target value. The function should return the index where this value is located in the list, or -1 if the value is not present.

numbers = [1, 5, 7, 10, 20, 100]

def find_index(numbers, key):
    ...