python 统计小说词数(完整,无bug,优化版)
import oswith open('DouJuan', encoding='utf-8') as file_obj: contents = file_obj.read() print(contents)string = contents.lower()string = string.replace("\n"," ")# 删除字符串内除了字母与空格的字符 例如@#$%^&*()_+:<>.|}&qu