擅长:python、mysql、java
<p>创建一个名为matrice的列表,如果索引与0匹配,则为每一行添加子列表(如果索引与0匹配,则为1)</p>
<pre><code>a=[95, 66, 137, 70, 20]
b=[36, 66, 44, 214, 105, 133]
c=[170, 66, 97, 153, 105, 138]
matrice=[]
matrice.append([1 if i in a else 0 for i in range(229)])
matrice.append([1 if i in b else 0 for i in range(229)])
matrice.append([1 if i in c else 0 for i in range(229)])
</code></pre>