我試圖使用if-else表達式,如果if條件失敗,但得到一個invalid syntax錯誤,應該打破循環。 示例代碼: a = 5 while True: print(a) if a > 0 else break a-=1 當然, ...
確定! 回上一頁