use dict.update rather than an unnecessary loop