title: Looping over dictionary keys appends too many dictionary values
body: <pre><code># list of dict keys
  function_vars = [&quot;x_reserve&quot;, &quot;y_reserve&quot;, &quot;wx&quot;, &quot;wy&quot;, &quot;decay_rate&quot;]
  
  # Initialize a dictionary with empty array values
  stats = dict.fromkeys(function_vars, [])
  
  for var in function_vars:
    print(var)
    stats[var].append(0)
  
  stats
  </code></pre>
  <p>I initialized a dictionary using function_vars elements as dictionary values. Then I want to create a loop that updates each dictionary key once. However I am getting 5x as many values as I anticipated:</p>
  <pre><code>    {'decay_rate': [0, 0, 0, 0, 0],
   'wx': [0, 0, 0, 0, 0],
   'wy': [0, 0, 0, 0, 0],
   'x_reserve': [0, 0, 0, 0, 0],
   'y_reserve': [0, 0, 0, 0, 0]}
  </code></pre>
  <p>but the output should be</p>
  <pre><code>    {'decay_rate': [0],
   'wx': [0],
   'wy': [0],
   'x_reserve': [0],
   'y_reserve': [0]}
  </code></pre>
  <p>What is going on with my logic? I am not sure what I am missing and how to fix my (wrong) results</p>