def count_hits_per_gene(gene_pos, hits, max_dist = 10):
    """
    Args:
        genePos: A dictionary of gene positions
        hits: A list of positions of hits
        maxDist (optional): The maximum distance to be associated to a gene
    Returns:
        A dictionary that associates to each gene the number of hits with
        distance maxDist
    """   
    # You may find this useful: it creates a new dictionary with
    # the same keys as the gene_pos dictionary, and values 0
    # hit_count=dict.fromkeys(gene_pos.keys(),0)
  
    # WRITE YOUR QUESTION 6 CODE HERE
    hit_count=dict.fromkeys(gene_pos.keys(),0)
    for key, val in gene_pos.items():
        for elem in hits:
            if  val <= (elem + max_dist) and val >= (elem - max_dist):
                hit_count [key] += 1
    return hit_count