生成器就是不把一個列表一下全部導入到內存中,而是一個一個生成 創建生成器 推導式創建生成器 []生成的是列表 ()生成的是生成器 In [1]: [x for x in range(5)]
Out[1]: [0, 1, 2, 3, 4]In [2]: (y for y in range(5))
Out[2]: <generator object <genexpr>
1._*:The special identifier _ is used in the interactive interpreter to store the result of the last evaluation; it is stored in the builtins module. When not in interactive mode, _ has no special meaning and is not defined 2.__*__系統定義的名稱, 3.__*類的