我有功能:
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
我怎样才能解决这个问题?
最佳答案
尝试:
def make_happiness_table(filename="word-happiness.csv"):
''' make_happiness_table: string -> dict
creates a dictionary of happiness scores from the given file '''
return {}