Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ';需要语法错误帮助_Python_Syntax Error - Fatal编程技术网

Python ';需要语法错误帮助

Python ';需要语法错误帮助,python,syntax-error,Python,Syntax Error,我是Python新手,我的游戏《寻找钻石之剑》有问题。 每当我运行脚本时,它都会不断出现 File "/Users/parent/Desktop/Python applets/The Quest for the Diamond Sword.py", line 16 if direction == 'Right' ^ SyntaxError: invalid syntax 我已尝试将“a”改为“a”,但无效。结尾需要冒号;例如 if d

我是Python新手,我的游戏《寻找钻石之剑》有问题。 每当我运行脚本时,它都会不断出现

File "/Users/parent/Desktop/Python applets/The Quest for the Diamond Sword.py", line 16
    if direction == 'Right'
                          ^
SyntaxError: invalid syntax

我已尝试将“a”改为“a”,但无效。

结尾需要冒号;例如

if direction == 'Right':