# replace with your code here
import re
f = open('D:\金融数据获取与处理\作业一素材.txt', mode='r', encoding='utf-8')
txt = f.read()
f.close()
line1 = txt.splitlines()
line2= line1[-3]
x = re.split("\s", line2)
word1=x[-1]
word2 =word1.split('.')
word3=word2[0]
len_word3=len(word3)
print(len_word3)
如代码所示