In [1]:
f = open('作业一素材.txt',mode='r', encoding='utf-8')
text = f.read()
f.close()


suffix = '顺丰控股股份有限公司'

index = text.find(suffix)
text = text[0:index]

lines = text.splitlines()
line = lines[-1]
words = line.split(' ')
word = words[-1]
word = word[:-1]
len(word)
Out[1]:
6
In [ ]: