f1 = open("作业一素材.txt", 'r', encoding='utf-8')
txt1 = f1.read()
f1.close()
last_word=txt1.split()[-6].replace('.','')
print('最后一个单词:{}'.format(last_word),'\n长度为{}'.format(len(last_word)))
f2 = open("作业一附加选做题素材.txt", 'r', encoding='utf-8')
txt2 = f2.read()
f2.close()
last_sentence=txt2.split('。')[-2].replace('\n','')
print('\n最后一个句子:',last_sentence,'\n长度为{}'.format(len(last_sentence)))