我正在学习python我卡在一个小程序中,我什至像视频中一样键入了代码,但仍然无法正确运行,这里是代码
import json
data = json.load(open("data.json"))
def translate(word):
return data[word]
word = input("please enter a word ")
print(translate(word))
我用Rain(雨)一词为例,这是错误
Traceback (most recent call last):
File ".\dectionnaire.py", line 7, in <module>
word = input("please enter a word ")
File "<string>", line 1, in <module>
有人可以帮忙吗,谢谢您