import re f = open('作业一素材.txt', encoding='utf-8') text = f.read() lines = text.splitlines() line = lines[-1] words = line.split(' ') word = words[-1] word = word[0:-1] print(len(word))
6