#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 18 19:02:28 2023 @author: linhonghua """
# replace with your code here
import re
f = open('/Users/linhonghua/Downloads/作业一素材.txt',encoding='utf-8')
txt = f.read()
f.close()
lines = re.split('[\n]', txt) #分割文本
line = lines[-3] #不考虑页脚,文本中最后一行为倒数第三行
words = line.split(' ') #用空格分割单词
length = len(words[-1])-1 #去掉符号得出长度
print(length)