Python自帶的itertools模塊就能實現
import itertools
nums = itertools.permutations([1,2,3])
for x in nums:
print(x)
>>>
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
Python自帶的itertools模塊就能實現
import itertools
nums = itertools.permutations([1,2,3])
for x in nums:
print(x)
>>>
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
繼續運行 🥋 回憶上次內容 上上次 真寫了 萬行 代碼 這 萬行 代碼 都是寫在 明面 上的 這次 使用git命令 下載了 github上面的倉庫