title: Is it possible to populate a hash using a `for` loop?
body: <p>I want a hash that holds ints from 1 to 18 as the keys. I want the hash to look like this:</p>
  
  <pre><code>myHash = Hash.new
  myHash[1] = "free"
  myHash[2] = "free"
  ...
  myHash[18] = "free"
  </code></pre>
  
  <p>I want to know if there's a nicer way to do this, such as using a <code>for</code> loop. Will something like:</p>
  
  <pre><code>myHash = Hash.new
  for i in 1..18
  myHash[i] = "free"
  </code></pre>
  
  <p>work, or will it just create 18 keys called <code>i</code>?</p>