import re
f = '作业一素材.txt'
with open(f, 'r',encoding='utf-8') as f:
lines = f.readlines()
last_line = lines[-3]
goal=last_line.split(" ")
word=goal[-1]
goal = re.split(r'[.]', word)
word = goal[0]
print("所求结果为",len(word))
如果所写代码复杂,且没有良好的注释,那么请在这里补充解释。