#文件名
# apple 12 2
# fhal 34 1
# fsdh 45 5
# fjff 2000 6
# ddd 10 3
# with open('aaa.txt',encoding='utf-8',mode='r') as f1:
# lis = []
# for line in f1:
# line = line.strip()
# li = line.split(' ')
# dic = {}
# dic['name'] = li[0]
# dic['price'] = li[1]
# dic['amount'] = li[2]
# lis.append(dic)
# print(lis)
#*****
li = []
name_list = ['name','price','amount']
with open('aaa.txt',encoding='utf-8',mode='r') as f1:
for line in f1:
line_list = line.strip().split(' ')
dic = {}
for i in range(len(name_list)):
dic[name_list[i]] = line_list[i]
li.append(dic)
print(lis)