What is the output for the given python code?

def test(arr, a, b):
    for i in range(0, a):
        if (arr[i] == b):
            return i
    return -1
arr = [12, 9, 37, 86, 2]
b = 17
a = len(arr)
index = test(arr, a, b)
print(index)

1
5
2
4
3
0
4
-1

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation