for filename in ["zuoye/wenjian/毕业的日子.txt", "zuoye/wenjian/花开如笑.txt", "zuoye/wenjian/最平凡处最美丽.txt"]:
with open(filename, "r") as file:
count = 0
comment = file.read()
for i in comment:
if i == "。" or i == "!" or i == "?":
count += 1
print(filename[14:]+"共有%d句。" % count)
结果: