global a # 宣告a 變數為外部之全域變數. a='world' # 重新賦值(建立新物件). print('a=', a, 'id=', id(a)). >>> func(). a= world id= 2452239476696 # ...
確定! 回上一頁