title: If I have 2 lists in a dictionary, how to append both of them at once?
body: <pre><code>    self.W = {}
      self.W[A] = {'x':[], 'y':[]}
  </code></pre>
  <p>I want to do the following:</p>
  <pre><code>   self.W[A]['x'].append(X)
  </code></pre>
  <p>and:</p>
  <pre><code>   self.W[A]['y'].append(Y),
  </code></pre>
  <p>at once.</p>
  <p>How to do both in one command?</p>
  <h1>Edit:</h1>
  <p>Let me write it in more clear way:</p>
  <pre><code>WEAPONS = {}
  WEAPONS['launcher'] = {'idle_img' : [ &quot;pic1.png&quot;, &quot;pic2.png&quot;, &quot;pic3.png&quot;],
                         'shoot_img' : ['img1.png', 'img2.png', 'img3.png'],
                
  
                     
  
  WEAPONS['pistol']  =  {'idle_img' : [ &quot;another_pic1.png&quot;, &quot;another_pic2.png&quot;,'another_pic3'],
                         'shoot_img' : ['another_img1.png', 'you know.png', 'abcxyz.png']}
  </code></pre>
  <p>now I have another <code>dict</code>:</p>
  <pre><code>self.another_dict = {}
  self.another_dict['launcher'] = {'idle_img' : [],
                                   'shoot_img' : [],
                
  
                     
  
  self.another_dict['pistol']  =  {'idle_img' : [],
                                   'shoot_img' : []}
  </code></pre>
  <p>Now, I want to add those images in <code>WEAPONS['pistol']['idle_img']</code> to <code>self.another_dict['pistol']['idle_img']</code></p>
  <p>also do it with ['shoot_img'] (and a lot of ['something_img'] like that too).I can do that one by one :</p>
  <pre><code>for l in WEAPONS:
          for i in self.WEAPONS[l]['idle_img']:
            self.another_dict[l]['idle_img'].append(i)
  </code></pre>
  <p>but that kind of long if I do that for all those ['   _img']</p>
  <p>So, I assume there must be a way to do them at once, or there will be a lot of writing.</p>