title: how to save the output to a.txt, i have some error
body: <p>i am practice save to txt but i get some error.</p>
  
  <p>my code
  <a href="http://dpaste.com/3MR3TZF" rel="nofollow">http://dpaste.com/3MR3TZF</a></p>
  
  <p>you can see the 65th :</p>
  
  <pre><code>f.write(tag+"\n")
  </code></pre>
  
  <p>i get the error <code>UnicodeEncodeError: 'ascii' codec can't encode character</code>,</p>
  
  <p>but i allready # -<em>- coding: utf-8 -</em> in my code 1th</p>
  
  <p>the second error is </p>
  
  <p>74th , <code>d = float (c)/((a+b)-c)</code>
  75th , <code>f.write(d+"\n")</code></p>
  
  <pre><code>TypeError: unsupported operand type(s) for +: 'float' and 'str'
  </code></pre>
  
  <p>how to slove it?</p>