text_plain_output_1.png
import csv

population_reader = csv.reader(open('../input/population/population.csv', 'r'))
population_dict = {}
next(population_reader)
for row in population_reader:
    k, v = row
    population_dict[k] = int(v)

pop_by_region_reader = csv.reader(open('../input/populationbycity/populationbycity.csv', 'r'))
populationbyregion_dict = {}
next(pop_by_region_reader)
for row in pop_by_region_reader:
    k, v = row
    populationbyregion_dict[k] = int(v)

def get_population(country, region):
    if region != '':
        if region in populationbyregion_dict:
            return populationbyregion_dict[region]
        else:
            return 1000000
    elif country != '':
        if country in population_dict:
            return population_dict[country]
        else:
            return 1000000
    else:
        return 1000000

print(get_population('Denmark', ''))