# -*- coding: utf-8 -*- """ Created on Wed Mar 9 11:26:00 2022 @author: 小田 """ f = open('作业一素材.txt',encoding='utf-8') txt = f.read() f.close() txtf = txt.rstrip('顺丰控股股份有限公司\nS.F. HOLDING CO., LTD.') str = txtf.split() print(len(str[-1]))