我不断收到一个语法错误与下面的代码行:我不断收到一个语法错误
# If the user asked for celsius then x will be a Celsius number converting to Fahrenheit number
if x = = c
你有什么想法?
我不断收到一个语法错误与下面的代码行:我不断收到一个语法错误
# If the user asked for celsius then x will be a Celsius number converting to Fahrenheit number
if x = = c
你有什么想法?
的= =
应该是你使用==
代替= =
(如果不明确),如==
if x == c:
确认 - >与==
取代=[SPACE]=
。
添加冒号以除去空间。
您需要提供更多信息。将确切的错误信息以及周围的代码复制到上面的'=='。顺便说一句,你是否试图检查变量'x'是否包含字母'c'?如果是这样,请使用'if x ==“c”:' –
请显示完整的代码。另外:http://docs.python.org/tutorial/controlflow.html – Drakosha