回答編集履歴
1
ソースの追記
test
CHANGED
@@ -51,3 +51,91 @@
|
|
51
51
|
f
|
52
52
|
|
53
53
|
```
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
2016/8/28追記:
|
60
|
+
|
61
|
+
0or1のある・ないだけ知れば良いのであればディクショナリ型を使うまでもなさそうですね。
|
62
|
+
|
63
|
+
set型にしてitem名だけ保持させて、呼び出し時に判定します。
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
```python
|
68
|
+
|
69
|
+
table = []
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
table.append(["a","c","d"])
|
74
|
+
|
75
|
+
table.append(["a","b"])
|
76
|
+
|
77
|
+
table.append(["a","d"])
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
print "a" in table[0]
|
82
|
+
|
83
|
+
print "b" in table[0]
|
84
|
+
|
85
|
+
print "c" in table[0]
|
86
|
+
|
87
|
+
print "d" in table[0]
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
print "a" in table[1]
|
92
|
+
|
93
|
+
print "b" in table[1]
|
94
|
+
|
95
|
+
print "c" in table[1]
|
96
|
+
|
97
|
+
print "d" in table[1]
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
print "a" in table[2]
|
102
|
+
|
103
|
+
print "b" in table[2]
|
104
|
+
|
105
|
+
print "c" in table[2]
|
106
|
+
|
107
|
+
print "d" in table[2]
|
108
|
+
|
109
|
+
```
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
実行結果
|
114
|
+
|
115
|
+
```
|
116
|
+
|
117
|
+
True
|
118
|
+
|
119
|
+
False
|
120
|
+
|
121
|
+
True
|
122
|
+
|
123
|
+
True
|
124
|
+
|
125
|
+
True
|
126
|
+
|
127
|
+
True
|
128
|
+
|
129
|
+
False
|
130
|
+
|
131
|
+
False
|
132
|
+
|
133
|
+
True
|
134
|
+
|
135
|
+
False
|
136
|
+
|
137
|
+
False
|
138
|
+
|
139
|
+
True
|
140
|
+
|
141
|
+
```
|