with open('eng_file.txt','r', encoding='utf-8-sig') as eng_file, open('rus_file.txt', 'r', encoding='utf-8-sig') as rus_file:
eng = map(str.rstrip, eng_file)
rus = map(str.rstrip, rus_file)
data = dict(zip(eng, rus))
n=input('what laguage? 1 Englis, 2 Russian')
if int(n)==1:
word =input('English ')
if word in data.keys():
print(f'word: {word} is found: {data[word]}')
if word not in data.keys():
print('word is not found')
if word not in data.keys():
print('would you like to input the word to the dictionary?:1 yes,2 no')
c=input('')
if c=='1':
english,russian=input_word(english,russian)
print(english)
print(russian)
elif c=='2':
break
if int(n)==2:
with open('eng_file.txt','r', encoding='utf-8-sig') as eng_file, open('rus_file.txt', 'r', encoding='utf-8-sig') as rus_file:
eng = map(str.rstrip, eng_file)
rus = map(str.rstrip, rus_file)
data = dict(zip(rus, eng))
word =input('Russian')
if word in data.keys():
print(f'word: {word} is found: {data[word]}')
if word not in data.keys():
print('word is not found')
if word not in data.keys():
print('would you like to input the word to the dictionary?:1 yes,2 no')
c=input('')
if c=='1':
english,russian=input_word(english,russian)
print(english)
print(russian)
elif c=='2':
break