Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.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
简单if语句的Python语法错误_Python_If Statement_Syntax Error - Fatal编程技术网

简单if语句的Python语法错误

简单if语句的Python语法错误,python,if-statement,syntax-error,Python,If Statement,Syntax Error,我的if语句中出现语法错误: print "Welcome to the English to Pig Latin translator!" original = raw_input("Please enter a word to be translated: ") word_length = len(original) def length_check(): If (word_length) > 0 : <-- This colon brings up the foll

我的if语句中出现语法错误:

print "Welcome to the English to Pig Latin translator!"

original = raw_input("Please enter a word to be translated: ")
word_length = len(original)

def length_check():
    If (word_length) > 0 : <-- This colon brings up the following error:
        return original


File "python", line 7
    If (word_length) > 0 :
                         ^
SyntaxError: invalid syntax
print“欢迎来到英语到拉丁语的翻译人员!”
原始=原始输入(“请输入要翻译的单词:”)
单词长度=长度(原件)
def长度检查()
如果(字长)>0:0:
^
SyntaxError:无效语法

如果
应更改为
如果
。注意小写的
i

>>> If True:

SyntaxError: invalid syntax
>>> if True:
        print True


True

您可能需要阅读。

If
应更改为
If
。注意小写的
i

>>> If True:

SyntaxError: invalid syntax
>>> if True:
        print True


True

你可能需要仔细阅读。

@user2735954:很高兴我能帮上忙。别忘了……)@用户2735954:很高兴我能帮上忙。别忘了……)