from typing import List
from typing import Tuple


def process_results(search_results: List) -> Tuple[dict, int]:
    """
    Prints the search results in an appropriate format and maps them in a dictionary.
    """

    print("Showing the most relevant fetched results.\n")

    result_index = {}

    for i, show in enumerate(search_results):
        # search_results is a list of tv show objects
        # map the shows
        result_index[i + 1] = show

        # print the name, year and country(country given to us in list form)
        if not show["origin_country"]:
            show["origin_country"].append("N/A")

        if not show["first_air_date"]:
            show["first_air_date"] = "N/A"

        print(
            f"{i+1}. {show['name']}, {show['first_air_date'][:4]}, \
{show['origin_country'][0]}"
        )

    return result_index, len(result_index)