import fileinput
import os
name = ['vasya', 'nikita', 'amogus', 'shutka']
salary = [str(49900), str(50001), str(32222), str(9888)]
file = open('salary.txt', 'w', encoding='utf-8')
NameSalary = dict(zip(name, salary))
# {'vasya': 49900, 'nikita': 50001, 'amogus': 32222, 'shutka': 9888}
print(NameSalary)
file = open('salary.txt', 'w', encoding='utf-8')
file.write(NameSalary.popitem(0))
file.close()
name = ['vasya', 'nikita', 'amogus', 'shutka']
salary = [str(49900), str(50001), str(32222), str(9888)]
NameSalary = dict(zip(name, salary))
with open('salary.txt', 'w', encoding='utf-8') as file:
file.write(str(NameSalary))
# ./salary.txt
# {'vasya': '49900', 'nikita': '50001', 'amogus': '32222', 'shutka': '9888'}