human
Write me a Python program to get the index of a value based on conditions.
assistant
Here is a Python program to get the index of a value based on conditions

import random

def _getIndex(value, array, condition):
    """
    Get the index of a value in based on conditions
    """
    for i in range(len(array)):
        if condition(array[i]):
            return i
    return -1

# Enter the value
value = 10

# Enter the array
array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]

# Enter the condition
condition = lambda x: x == value

# Calling the function
print((_getIndex(value, array, condition)))

#Example Output
# 9

#Remember to inspect code for bugs.