LoginSignup
0
0

More than 5 years have passed since last update.

Itertoolsを使って重複あり順列の全てのパターンを列挙する

Last updated at Posted at 2018-02-21
qiita.py
 import itertools
 list(itertolls.product("abc",repeat=3))
>>>[("a","a","a"),("a","a","b")...("c","c","c")] #全部で27パターン

list(itertolls.product("abc"),repeat=2))とlist(itertolls.product("abc")("abc")("abc"))は同じ意味。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0