error in code involving while loop and removing items from string
<p>I have a code that downloads tweets and I am trying to sort through it labeling it as positive or negative each time i label a tweet I want to remove it from the string so I won't be asked to label it again here is my code so far</p>

<pre><code>while True:
    if len(tweet_list) == 0:
        break
    else:
        tweet1= (np.random.choice(tweet_list))
        print tweet1
        judge = input("1 pos, 2 neg 3 skip: ")
        if judge == 1:
            tweet_pos.append(tweet1)
            tweet_list.remove(tweet1)
        if judge == 2:
            tweet_neg.append(tweet1)
            tweet_list.remove(tweet1)
</code></pre>

<p>after I label the second tweet I am given this error</p>

<pre><code>ValueError: list.remove(x): x not in list
</code></pre>

<p>You could do something like:</p>

<pre><code>newList = []
for myLetter in myList:
    if myLetter is not 'x':
        newList.append(myLetter)

newString = ''.join(newList)
</code></pre>

python string while-loop tweepy