def extract_var(data, var):
    """Returns a list of values corresponding to a variable name.

    >>> foo = [{"name": "Shane", "age": 22}, {"name": "Eve", "age": 7}]
    >>> extract_var(data=foo, var="name")
    ["Shane", "Eve"]
    """

    return [x[var] for x in data]