human
first index of a list that validates a condition.
assistant
Here is a Python function to find the first index of a list that validates a condition

import re

def first_index(list, condition):
    """
    >>> list = [0, 0, 7]
    >>> first_index(list, lambda x: x == 7)
    2
    """
    for i in range(len(list)):
        if condition(list[i]):
            return i
    return -1

# Enter the list
list = [0, 0, 7]

# Calling the function
print((first_index(list, lambda x: x == 7)))

#Example Output
# 2

#Remember to inspect code for bugs.