代码
import re
def re_handle(text):
words = re.findall('(\w+)\s*', text)
return words
def get_number(text):
return len(re_handle(text))
with open('text.txt')as text:
text = text.read()
print(get_number(text))
import re
def re_handle(text):
words = re.findall('(\w+)\s*', text)
return words
def get_number(text):
return len(re_handle(text))
with open('text.txt')as text:
text = text.read()
print(get_number(text))