title: Insert data into text file python
body: <p>I was wondering how do you insert a variable's content into a text file using python?
  I'm quite new to this so I would appreciate some help.
  Here's my code:</p>
  
  <pre><code>a,b = raw_input('Enter in format number^power').split('^')
  a = int (a)
  b = int (b)
  result = a**b
  with open("test34.txt", "a") as myfile:
      myfile.write("result")
  print ("Done!")
  raw_input()
  </code></pre>