标签: python python-2.7
我正在运行Python 2.7.6,当我执行以下if语句时。但是,如果我添加注释掉的elif行,我会收到语法错误。任何想法
if output == 0: print(Num,"is Even") # elif output = 0: # print(Num,"is Odd" ) else: print (Num,"is Odd")
答案 0 :(得分:1)
你想在elif中输出== 0,这是比较而不是输出= 0(这是赋值)