File?=?"words.txt"
number_list?=[]
with?open(File)?as?f:
for?line?in?f:number_list.extend(?str(i)?for?i?in?line.split())
for?item?in?set(number_list):
L=[item,number_list.index(item),number_list.count(item)]
print(L)?#單詞?首次出現的位置?詞頻
with?open('Q1.txt','a')?as?F:
F.writelines(str(L))