def does_group_exist(iam, group_name):
    """Check if the group name exists.

    Parameters
    ----------
    iam: iam client, required
    group_name: string, required

    Returns
    ------
        bool: returns if the group exists
    """
    group_exists = False

    try:
        response = iam.get_group(GroupName=group_name)

        if "Group" in response:
            group_exists = True

    except iam.exceptions.NoSuchEntityException as e:
        group_exists = False
        print(e)

    return group_exists