def calc_f1(precision: float, recall: float):
    """Calculates the F1 score

    Args:
        precision (float): The calculated precision
        recall (float): The calculated recall

    Returns:
        float: The F1 score
    """
    
    if precision + recall == 0:
        return 0
    return 2 * ((precision * recall) / (precision + recall))