回答編集履歴
1
誤字修正
test
CHANGED
@@ -21,3 +21,41 @@
|
|
21
21
|
'float' object is not callable
|
22
22
|
|
23
23
|
```
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
組み込み関数 `callable` を使うと伝わりやすいかもしれません。
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
def f():
|
34
|
+
|
35
|
+
pass
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
y = 0
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
callable(f)
|
44
|
+
|
45
|
+
callable(x)
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
>>> callable(f)
|
52
|
+
|
53
|
+
True
|
54
|
+
|
55
|
+
>>> callable(y)
|
56
|
+
|
57
|
+
False
|
58
|
+
|
59
|
+
>>>
|
60
|
+
|
61
|
+
```
|