What is the benefit of clearing a dictionary, when you can just reassign
it as empty? Similarly, suppose I generate a new dictionary b, and need
to have it accessible from a. What is the best method, under which
circumstances?
.... a[key] = b[key]
it as empty? Similarly, suppose I generate a new dictionary b, and need
to have it accessible from a. What is the best method, under which
circumstances?
>>import some_function
>>a = {1:2,3:4}
>>b = {1:2:4:3}
>>a.clear()
>>a.update(b)
>>b = {1:2:4:3}
>>a.clear()
>>a.update(b)
>>a = {1:2,3:4}
>>b = {1:2,4:3}
>>for key in b:
>>b = {1:2,4:3}
>>for key in b:
>>a = {1:2,3:4}
>>b = {1:2,4:3}
>>a = b
>>b = {1:2,4:3}
>>a = b
Comment