It looks raw
![Confused Confused](https://python-forum.io/images/smilies/confused.png)
fin = open('input.txt', 'r', encoding='utf8') fout = open('output.txt', 'w', encoding='utf8') data = list(map(lambda x: x.split(), fin.readlines())) myDict = {} for i in data: myDict[i[0]] = {i[1]: int(i[2])} print(myDict, file=fout)I know that my innerdictionary gets rewritten everyt time there is a new value in the loop. So, that's what I get in the end:
{'Smith': {'Apple': 10}, 'Davis': {'Apple': 30}, 'Brown': {'Potato': 50}, 'Miller': {'Cucumber': 40}}