import re
t = open('作业一素材.txt', mode='r', encoding='utf-8')
txt = t.read()
x=re.split("\n", txt)
line = x[-3]
words = re.split("\s", line)
word = words[-1][:-1]
print("最后一个单词",word,"的长度是",len(word))
import re
t = open('附加题素材.txt', mode='r', encoding='utf-8')
txt = t.read()
x = re.split("。", txt)
s = x[6]
n = re.split(",", s)
print("最后一个句子为:",n[-1],"它的长度是",len(n[-1]))