用到python,自己设计一个函数,实现某个功能 。江郎才尽了
# 一个函数用于读取文件返回文本对应的词数
def count_words(filename):
with open(filename, 'r') as f:
content = f.read()
words = content.split()
return len(words)
def(a,b):
return a+b
function add(a,b){
return a+b;
}