李禹含的作业一

代码


 f = open('D:\python\作业一素材.txt',encoding='utf-8')
 txt = f.read()
 f.close()
 line1 = txt.splitlines()
 line2 = line1[-3]
 word = line2[-7:-1]
 length = len(word)
 print(length)


结果

结果截图

解释

解释详见字里行间的注释