import math
import pickle
import os

def create_slovar(list1, list2, filename):
    slovar = dict(zip(list1, [math.log(abs(x)) for x in list2]))
    fp=open(os.getcwd()+ '/TEMA7/' + filename, 'wb')
    pickle.dump(slovar, fp)
    fp.close()


# Примеры использования функции
# Пример 1
list1 = ['a', 'b', 'c']
list2 = [1, 2, 3]
create_slovar(list1, list2, 'Slovar.bin')

fp=open(os.getcwd()+ '/TEMA7/' + 'Slovar.bin', 'rb')
slovar = pickle.load(fp)
fp.close()
print('\nПример 1:', slovar)

# Пример 2
list3 = ['x', 'y', 'z']
list4 = [4, 25, -6]
create_slovar(list3, list4, 'Slovar.bin')

fp=open(os.getcwd()+ '/TEMA7/' + 'Slovar.bin', 'rb')
slovar = pickle.load(fp)
fp.close()
print('\nПример 2:', slovar)