|
|
|
|
@ -14,7 +14,7 @@ def process_dictionary_sinus(input_dict, filename):
|
|
|
|
|
#создаю новый словарь с синусами значений
|
|
|
|
|
new_dict = {}
|
|
|
|
|
for key, value in input_dict.items():
|
|
|
|
|
new_dict[key] = math.sin(value)
|
|
|
|
|
new_dict[key] = math.sin(value)#для каждого ключа вычисляю синус значения и сохраняю в новый словарь
|
|
|
|
|
|
|
|
|
|
#записываю новый словарь в бинарный файл
|
|
|
|
|
with open(filename, 'wb') as file:
|
|
|
|
|
@ -42,7 +42,7 @@ def simple_test():
|
|
|
|
|
dict2 = {'данные1': 2.5, 'данные2': -1.2, 'данные3': 0.8}
|
|
|
|
|
|
|
|
|
|
#обрабатываем оба словаря
|
|
|
|
|
result1 = sdm.process_dictionary_sinus(dict1, 'dict1.bin')
|
|
|
|
|
result1 = sdm.process_dictionary_sinus(dict1, 'dict1.bin')#вызов фунции из первого модуля
|
|
|
|
|
result2 = sdm.process_dictionary_sinus(dict2, 'dict2.bin')
|
|
|
|
|
|
|
|
|
|
#выводим результаты
|
|
|
|
|
|