我刚刚启动了新版本的python,并意识到发生了很多变化。无论如何,eclipse 会在行号旁边出现一个红色的“X”标记,上面写着“Expected::”。有人可以解释一下这意味着什么,以及如何摆脱它吗?
这是我试图与 Eclipse 和新的 Python 版本一起使用的代码:
print "Please insert a valid operator that you want to calculate with."
print "Valid operators are +, -, : and *"
operator = str(raw_input("What's your operator? "))
numb1 = int(raw_input("Please insert the first number:"))
numb2 = int(raw_input("Please insert the second number:"))
if operator == "+":
print numb1 + numb2
elif operator == "*":
print numb1 + numb2
elif operator == "-":
print numb1 - numb2
elif operator == "/":
print numb1 / numb2