title: Can I add a string to a variable name?
body: <p>In the interest of efficiency, I'd like to be able to use an argument given when calling my function to determine which variables the function tries to get the values of without copy and pasting the same code 5 times but changing some numbers in the variables. e.g.</p>
  <pre><code>variable1 = &quot;hello&quot;
  variable2 = &quot;goodbye&quot;
  function(number):
       return(variable(number))
  </code></pre>
  <p>so ideally if i called <code>function(2)</code> it would return <code>variable2</code>. Is there a way to do this? Or should I just duplicate my code and change the variable number for each time I want to do this?</p>