some changing

This commit is contained in:
2022-06-29 23:17:16 +03:00
parent 25c76bd550
commit 2f9e202adc
4 changed files with 68 additions and 53 deletions

23
test3.py Normal file
View File

@@ -0,0 +1,23 @@
my_dict = {'key': 'value'}
print(my_dict)
my_dict.update({'another_key': 'another_value'}) # Дополняем.
print(my_dict)
my_dict.update({'another_key': 'yet_another_value'}) # Обновляем.
print(my_dict)
my_dict.update({"subdict": {}})
subdict = my_dict['subdict']
print(my_dict)
print(subdict)
subdict.update({'subdictkey': 'subdictvalue'})
print(subdict)
print(my_dict)
subdict.update({'subdictkey2': 'subdictvalue2'})
print(my_dict)
subdict.update({'subdictkey': '33'})
print(my_dict)
my_dict.update({'testKey': 'testValue'})
print(my_dict)
print(my_dict)