我的职责是:
def make_happiness_table("word-happiness.csv"):
''' make_happiness_table: string -> dict
creates a dictionary of happiness scores from the given file '''
return {}
但是我在运行程序的时候总是遇到语法错误。你知道吗
File "happiness.py", line 13
def make_happiness_table("word-happiness.csv"):
^
SyntaxError: invalid syntax
我怎样才能解决这个问题?你知道吗
不要在函数定义中给出实际的文件名,而是在调用函数时给出一个填充的变量,如下所示:
尝试:
相关问题 更多 >
编程相关推荐