title: Python - Delete comments in a Python code
body: <p>So i have to write a code that will delete every # comment in a Python code...
  I have written a code (files method) but it deletes everything...
  Any help will be appreciated.Thanks.</p>
  
  <p>My code:</p>
  
  <pre><code>code=open("comm.txt","r")
  for line in code:
  if (line.startswith("#")):
      del line
  code.close()
  </code></pre>