2011-09-17 29 views
0

我不断收到一个语法错误与下面的代码行:我不断收到一个语法错误

# If the user asked for celsius then x will be a Celsius number converting to Fahrenheit number 
if x = = c 

你有什么想法?

+2

您需要提供更多信息。将确切的错误信息以及周围的代码复制到上面的'=='。顺便说一句,你是否试图检查变量'x'是否包含字母'c'?如果是这样,请使用'if x ==“c”:' –

+1

请显示完整的代码。另外:http://docs.python.org/tutorial/controlflow.html – Drakosha

回答

6

= =应该是你使用==代替= =(如果不明确),如==

if x == c: 
2

确认 - >与==取代=[SPACE]=

1

添加冒号以除去空间。

相关问题