v = 1 -- 一個全域變數 do local v = v + 1 -- 一個遮蔽了變數v 的新區域變數 ... 故Python 3 中引入關鍵字 nonlocal ,用於避免變數遮蔽,而得以對非區域變數賦值:.
確定! 回上一頁