Код: Выделить всё
dictionary1 = {
"level1": {
"level2": {"levelA": 0, "levelB": 1}
}
}
update = {
"level1": {
"level2": {"levelB": 10}
}
}
dictionary1.update(update)
print(dictionary1)
Код: Выделить всё
{
"level1": {
"level2": {"levelB": 10}
}
}
Как я могу решить эту проблему, учитывая, что словарь 1 и обновление может иметь любую длину?
Подробнее здесь: https://stackoverflow.com/questions/323 ... ying-depth