-1
每當我嘗試使用else和elif時,我都會收到該錯誤。Python elif else syntaxError
x=4
if x>0:
print("positive")
elif x=4:
print("equal")
else:
print("negative")
消息錯誤:
File " '<'stdin'>' ", line 1
elif x=4 :
^
SyntaxError: invalid syntax
File "'<'stdin'>'", line 1
else:
^
SyntaxError: invalid syntax
'ELIF X = 4:' - >'elif的X == 4:' – falsetru
非常感謝花花公子^^ – El7or