def cities_in_EU(cities_data, countries_data):
    """Returns a dictionary whose key:value pair is "name of city":"EU membership",
    e.g., "Graz":"yes" or 'Aalborg':'no';
    the size of the dictionary must equal the number of cities represented in cities_data
    """
    # Hint:
    # Use nested for in loops to generate the dictionary:
    #
    # for city in cities_data:
    #    for country in countries_data:
    city = []
    country = []
    eu = []
    for i in range(len(cities_data)):
        city.append(cities_data[i]["city"])
        country.append(cities_data[i]["country"])
    for i in range(len(country)):
        for k in range(len(countries_data)):
            if country[i] == countries_data[k]["country"]:
                eu.append(countries_data[k]["EU"])
    answer_dict = {}
    for i in range(len(city)):
        answer_dict.update({city[i]: eu[i]})
    return answer_dict