title: Ruby "#<NoMethodError: undefined method `+' for nil:NilClass>"
body: <p>I have the following code which looks for the letters "u"and "e" in a word and add 1 to the index so that it shows position in the word starting from 1 rather than 0, and then have it combined into an array.</p>
  
  <pre><code>def vowel_indices(word)
    x = (word.index("u") + 1)  
    y = (word.index("e") + 1) 
    print = [x,y]
  end
  </code></pre>
  
  <p>I am getting the following error message when running:</p>
  
  <pre><code>#&lt;NoMethodError: undefined method `+' for nil:NilClass&gt;
  </code></pre>
  
  <p>What is nil in this? From what I can see my variables are assigned correctly.</p>