title: Saving file with the name of the array variable Python
body: <p>I am willing to save the file with the same name as the variable has. See teh following code:  </p>
  
  <pre><code>training = np.arange(200)
  np.savetxt(training.txt,training)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  AttributeError: 'numpy.ndarray' object has no attribute 'txt'
  </code></pre>
  
  <p>When I use double quotes it will work as obvious:</p>
  
  <pre><code>np.savetxt("training.txt",training)
  </code></pre>
  
  <p>But in my program there are different variables and I want that when I call the file saving function the file name should automatically be taken as the variable name itself.<br>
  For example, if the variable is <code>question</code>, or <code>answer</code>, then when I say <code>save()</code>, the file name should automatically be <code>question.txt</code> or   <code>answer.txt</code><br>
  Suggest me what I can do to achieve this.</p>