import shutil


def check_installed_tools(desired_tools):
    """Prints out if any or all of the tools required are installed on the user's machine.

    Args:
        desired_tools(list): list of the tools wished to be run, e.g. ['pracrand', 'ent',
            'dieharder'].

    Returns:
        list: list of actually installed tools, e.g. ['pracrand', 'dieharder'].
    """
    installed_tools = []
    for tool in desired_tools:
        if shutil.which(tool) is not None:
            print(f"{tool.capitalize()} is installed and in path\n")
            installed_tools.append(tool)
        else:
            print(f"{tool.capitalize()} is not installed or not in path")
            print(f"{tool.capitalize()} tests won't be run...\n")
    return installed_tools