I'm following the book "Learn Python The Hard Way" And I don't understand what is going on in this function in Exercise 39.
def new(num_buckets=256): #So the function is made and its named "new" and the argument inside is """Initializes a Map with the given number of buckets.""" aMap = [] #then it creates an empty list and names it aMap for i in range(0, num_buckets): #This loop is created named i and it is ranging from 0-255. aMap.append([]) #then it adds a list inside our aMap variable. return aMap I don't know what the "for i in range(0,num_bucketss) is doing here. What is it doing the append command?
print(i)and think how aMap changes each time. Also, think about the variable namenum_buckets...