推 Django: not就是把False/True的值反轉再來判斷 06/18 10:32
→ Django: 不過那一行沒加括弧看起來毛毛的 06/18 10:33
推 LessonWang: 優先順序 not>and>or 06/18 10:34
→ LessonWang: not 1+1==y 是False 06/18 10:36
→ LessonWang: x==4 and 7==8 是False 06/18 10:36
→ LessonWang: False or False 是False 06/18 10:37
→ yimean: 所以當if判斷式後方的結果是False就不會執行下方的內容 06/18 10:38
→ yimean: 嗎? 06/18 10:38
推 LessonWang: 也就是 ((not 1+1==y) or (x==4 and 7==8)) 06/18 10:40
→ LessonWang: if 後面的運算式 只有True才會執行 06/18 10:41
→ yimean: 了解 感謝解惑 06/18 13:27
推 fischcheng: 咦,elif冒號後面沒indent當然會顯示no啊 06/19 02:16