This is my code:
def getGraphWave(G, d, maxk, p):
    data = dict()
    output_wavelets = {2:33,5:77,...}
    print(len(output_wavelets)) 
    k = [10,20]  
    for i in k:
        S = graphwave(i, output_wavelets)
        # size = avgSize(G, S, p, 200)
        size = IC(d, S, p)
        data[i] = size + i
    return data
The output_wavelets is a dict and the length of it is 2000.
However, when running the following code:
def graphwave(k, output_wavelets):
    S = []
    print(len(output_wavelets))
    for i in range(k):
        Seed = max(output_wavelets, key=output_wavelets.get)
        S.append(Seed)
        output_wavelets.pop(Seed)
    return S
In the getGraphWave(G,D,maxk,p), graphWave(k,output_wavelets) runs two times in the circulation. However, Why in the graphWave(), the result of print(len(output_wavelets)) is 2000 and 1991?
I thought output_wavelets is not changed before output_wavelets. And how to let output_wavelets always be the original?
 
     
    