def iterate_pagerank(corpus, damping_factor):
    """
    Return PageRank values for each page by iteratively updating
    PageRank values until convergence.

    Return a dictionary where keys are page names, and values are
    their estimated PageRank value (a value between 0 and 1). All
    PageRank values should sum to 1.
    """
    pages = dict()
    N = len(corpus)
    keys_corpus = []
    for keys in corpus.keys():
        pages[keys] = 1/N
        keys_corpus.append(keys)
    
    for pag in corpus:
        if corpus[pag] == set():
            corpus[pag] = set(corpus.keys())
                
    condition = True
    while condition:
        for page in pages:
            page_rank = [x for x in corpus if page in corpus[x]]
            summation = [pages[i]/len(corpus[i]) for i in page_rank]
            sums = sum(summation)
            aux = (1-damping_factor)/N + (damping_factor*sums)
            
            if round((pages[page]-aux), 3) == 0.001:
                condition = False
            pages[page] = aux
            
    return pages