diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..dc9ea49 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ed7246c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/stud203989.iml b/.idea/stud203989.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/stud203989.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Readme.MD b/Readme.MD index e69de29..51e5248 100644 --- a/Readme.MD +++ b/Readme.MD @@ -0,0 +1,9 @@ +deep_update(d: dict, path: str, value: any) -> dict + +Обновить вложенный словарь по пути, заданному через точку. Пример: "a.b.c" → d["a"]["b"]["c"] = value. + +deep_update({"a": {"b": {"c": 1}}}, "a.b.c", 42) → {"a": {"b": {"c": 42}}} +Тесты: + +assert deep_update({"a": {"b": {"c": 1}}}, "a.b.c", 42) == {"a": {"b": {"c": 42}}} +assert deep_update({}, "x.y", 5) == {"x": {"y": 5}} \ No newline at end of file diff --git a/main.py b/main.py index e69de29..3f57928 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,5 @@ +def function(n): + #код программы + + +#вызов функции diff --git a/test.py b/test.py new file mode 100644 index 0000000..e69de29