from typing import List


def precision(results: List[bool], expected: List[bool], target_class: bool) -> float:
    """
    Calculates the precision value of a set of results for a given class
    :param results:       Resulting class predictions
    :param expected:      Expected classes
    :param target_class:  Class to calculate the precision for
    :return:              The precision of the results for the specified class
    """

    # Go through all result pairs
    labelled: int = 0
    true_positive: int = 0
    for result, target in zip(results, expected):
        if result == target_class:
            # Count all results labelled as the specified class
            labelled += 1
            if result == target:
                # And all results correctly labelled
                true_positive += 1
    # Return the precision value for the class
    return true_positive / labelled if labelled != 0 else 0.0