title: Removing extra \n from a string in python
body: <p>I've been learning Text recognition in python recently. When converting images to string it outputs an extra newline randomly in my images. I've tried removing it but cant seem to find a way how. My goal is to separate the choices into its corresponding strings</p>
  
  <p>Here is my code and image  :</p>
  
  <p><img src="https://i.stack.imgur.com/Gx9Ng.png" alt="ROI_0.png"></p>
  
  <pre class="lang-py prettyprint-override"><code>choices = cv2.imread("ROI_0.png", 0)
  custom_config = r'--oem 3 --psm 6'
  c = pytesseract.image_to_string(choices, config=custom_config, lang='eng')
  
  print(c.rstrip("\n"))  # my attempt
  text = repr(c)
  print(text)
  newtext = text.split("\\n")
  print(newtext)
  
  </code></pre>
  
  <p>Here is the outputs:</p>
  
  <pre><code>a. E. 0. 125
  
  b. R. A. 3846
  c. R. A. 3396
  d. R. A. 7925
  
  
  'a. E. 0. 125\n\nb. R. A. 3846\nc. R. A. 3396\nd. R. A. 7925'
  
  ["'a. E. 0. 125", '', 'b. R. A. 3846', 'c. R. A. 3396', "d. R. A. 7925'"]
  </code></pre>