from platform import python_compiler


def python_version(name):
    """
    Get compiler version used in Python.

    Parameters
    ----------
    name : str
        Compiler name.

    Returns
    -------
        float: version
    """

    version_str = python_compiler()
    if name not in version_str.lower():
        return 0.0
    return float(version_str.split(" ", 2)[1].rsplit(".", 1)[0])