回答編集履歴

4

修正

2020/06/09 07:33

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -14,6 +14,6 @@
14
14
 
15
15
  print(D_list)
16
16
 
17
- # [(1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)]
17
+ # [(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 2, 6), (1, 3, 3), (1, 3, 4), (1, 3, 5), (1, 3, 6), (1, 4, 3), (1, 4, 4), (1, 4, 5), (1, 4, 6), (1, 5, 3), (1, 5, 4), (1, 5, 5), (1, 5, 6), (1, 6, 3), (1, 6, 4), (1, 6, 5), (1, 6, 6), (2, 2, 3), (2, 2, 4), (2, 2, 5), (2, 2, 6), (2, 3, 3), (2, 3, 4), (2, 3, 5), (2, 3, 6), (2, 4, 3), (2, 4, 4), (2, 4, 5), (2, 4, 6), (2, 5, 3), (2, 5, 4), (2, 5, 5), (2, 5, 6), (2, 6, 3), (2, 6, 4), (2, 6, 5), (2, 6, 6), (3, 2, 3), (3, 2, 4), (3, 2, 5), (3, 2, 6), (3, 3, 3), (3, 3, 4), (3, 3, 5), (3, 3, 6), (3, 4, 3), (3, 4, 4), (3, 4, 5), (3, 4, 6), (3, 5, 3), (3, 5, 4), (3, 5, 5), (3, 5, 6), (3, 6, 3), (3, 6, 4), (3, 6, 5), (3, 6, 6)]
18
18
 
19
19
  ```何が何個でもproductでいけると思いますが...

3

修正

2020/06/09 07:33

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  D_list = list(product(A_list, B_list, C_list))
14
14
 
15
- print(C_list)
15
+ print(D_list)
16
16
 
17
17
  # [(1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)]
18
18
 

2

修正

2020/06/09 07:30

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  C_list = [3,4,5,6]
12
12
 
13
- C_list = list(product(A_list, B_list))
13
+ D_list = list(product(A_list, B_list, C_list))
14
14
 
15
15
  print(C_list)
16
16
 

1

修正

2020/06/09 07:30

投稿

ForestSeo
ForestSeo

スコア2722

test CHANGED
@@ -4,14 +4,16 @@
4
4
 
5
5
 
6
6
 
7
- A_list=[1,2] # 2つ
7
+ A_list = [1,2,3]
8
8
 
9
- B_list=[10,20,30,40] # 4つ
9
+ B_list = [2,3,4,5,6]
10
10
 
11
+ C_list = [3,4,5,6]
12
+
11
- C_list = list(product(A_list, B_list))
13
+ C_list = list(product(A_list, B_list))
12
14
 
13
15
  print(C_list)
14
16
 
15
- # [(1, 10), (1, 20), (1, 30), (1, 40), (2, 10), (2, 20), (2, 30), (2, 40)]
17
+ # [(1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)]
16
18
 
17
- ```2つでも4つでも何個でもproductでいけると思いますが...
19
+ ```何が何個でもproductでいけると思いますが...