This code takes forever to run but doesn't give an error : <p>I am trying to remove all instances of a particular character from a string by replacing the character with an empty string. Here is my code:</p>

<pre><code>string1="BANANA"
while string1.count("A") != 1:
    string1 = string1.replace("A","") 
</code></pre>

<p>This code takes forever to run and doesn't give an error. What is the problem?</p>
