def main():
x = True
y = False
z = False
if not x or y: #False
print (1)
elif not x or not y and z: #False
print (2)
elif not x or y or not y and x: #True
print (3)
else:
print (4)
main()
這是我們在Python類中學習的一個邏輯問題。我不明白答案是3怎麼回事,not x or y or not y and x
是True
,誰能幫忙?瞭解長布爾表達式的評估
你問過你的導師嗎? – TigerhawkT3