擅长:python、mysql、java
<p>你不需要结婚,你似乎已经拥有了你所需要的</p>
<p>您可以将列表附加到列表列表中</p>
<pre><code>mammal = ["monkey","dog","cat"]
amphibian = ["frog","toad","salamanders"]
aquatic = ["fish","eel","whale"]
animal_list = [mammal, amphibian, aquatic]
animal_list.append(['eagle'])
print(animal_list)
print(animal_list[2][2])
</code></pre>
<p>印刷品</p>
<pre><code>[['monkey', 'dog', 'cat'], ['frog', 'toad', 'salamanders'], ['fish', 'eel', 'whale'], ['eagle']]
whale
</code></pre>
<p>但是,您可以将结果转换为numpy数组</p>
<pre><code>np_animal_list = np.array(animal_list)
</code></pre>