title: Create a dictionary iterating two lists
body: <p>I'm building this dictionary that has as values the index of the list in which the animals appears.</p>
  <p>I have this two lists:</p>
  <pre><code>list1 = ['cow', 'fish', 'monkey', 'lion', 'cat', 'elephant', 'tiger', 'dog']
  list2 = [[['dog', 'cat', 'elephant', 'monkey'], ['dog', 'lion', 'tiger'], ['fish', 'dog', 'dog', 'cat', 'cow']]
  </code></pre>
  <p>And iterating through them I'm building my dictionary</p>
  <pre><code>dict = {}
  
  for i in list1:
      for index, item in enumerate(list2):
          if i in item:
              if i in dict.keys():
                  dict[i].append(index)
          else:
              dict[i] = index
  </code></pre>
  <p>The problem is: when it finds an item already in the dictionary keys, instead of just adding the index to the set of values it gaves me this error</p>
  <pre><code>dict[i].append(index)
  
  AttributeError: 'int' object has no attribute 'append'
  </code></pre>
  <p>The expected output should be:</p>
  <pre><code>dict = {'cow':[2], 'cat':[0,2], 'fish':[2], 'dog':[0,2], 'monkey':[0], 'lion':[1], 'elephant':[0], 'tiger':[1]}
  </code></pre>