Making dynamic lists to print out variables
<p>How can I make a dynamic list and then print it out, this example is just an idea of what I want to do, the lists could be in the hundreds.  </p>

<p>But I want anything that has cat to print "cat" with any value associated with it listed below it,</p>

<p>data = [["cat","one"], ["dog", "one"], ["cat", "ten"], ["frog", "one"], ["dog", "ten", "green"]]</p>

<pre><code>#Would like this to print out like:

cat
one
ten

dog
one
ten
green

frog
one
</code></pre>

<p>You can also use <code>setdefault</code>.</p>

<pre><code>result = {}
for animal, value in data:
    result.setdefault(animal, []).append(value)
print(result)
</code></pre>

python