回答編集履歴

1

修正

2019/08/29 03:56

投稿

can110
can110

スコア38233

test CHANGED
@@ -1,6 +1,8 @@
1
- ラムダ式の引数の数も渡してあげるようにすると、以下のように書けます。
1
+ ~~ラムダ式の引数の数も渡してあげるようにすると、~~以下のように書けます。
2
2
 
3
3
  ```Python
4
+
5
+
4
6
 
5
7
  from itertools import product
6
8
 
@@ -32,9 +34,9 @@
32
34
 
33
35
 
34
36
 
35
- # n : 引数の数
37
+ def table(a):
36
38
 
37
- def table(a, n):
39
+ n = a.__code__.co_argcount # 引数の数
38
40
 
39
41
  ls = []
40
42
 
@@ -48,7 +50,7 @@
48
50
 
49
51
 
50
52
 
51
- ls = table( lambda a, b: AND(a, OR(a, b)), 2)
53
+ ls = table( lambda a, b: AND(a, OR(a, b)))
52
54
 
53
55
  pprint(ls)
54
56
 
@@ -66,7 +68,7 @@
66
68
 
67
69
 
68
70
 
69
- ls = table( lambda a, b, c: EQ(AND(a, OR(b, c)), OR(AND(a, b), AND(a, c))), 3)
71
+ ls = table( lambda a, b, c: EQ(AND(a, OR(b, c)), OR(AND(a, b), AND(a, c))))
70
72
 
71
73
  pprint(ls)
72
74