title: How do I remove spaces in a string using a loop in python?
body: <pre><code>def onlyLetters(s):
      for i in range(len(s)):
          if s[i] == " ":
             s = s[:i] + s[i+1:]
             return s
          return s
  </code></pre>
  
  <p>Why is my above loop not working? It seems like it's only doing it once.</p>
  
  <p>For example, if i have the string "<strong>Hello how are you</strong>", it's returning "<strong>Hellohow are you</strong>". I want it to check the string again and remove another space, and keep doing it until there are no spaces left. How do I fix this code?</p>