Help thinking "Pythony"
<p>I'm brand new to Python and trying to learn it by replicating the following C++ function into python</p>

<pre><code>// determines which words in a vector consist of the same letters
// outputs the words with the same letters on the same line
void equivalentWords(vector &lt;string&gt; words, ofstream &amp; outFile) {
    outFile &lt;&lt; "Equivalent words\n";

    // checkedWord is parallel to the words vector. It is
    // used to make sure each word is only displayed once.
    vector &lt;bool&gt; checkedWord (words.size(), false);

    for(int i = 0; i &lt; words.size(); i++) {
        if (!checkedWord[i]){
            outFile &lt;&lt; "  ";
            for(int j = i; j &lt; words.size(); j++){
                if(equivalentWords(words[i], words[j], outFile)) {
                    outFile &lt;&lt; words[j] &lt;&lt; " ";
                    checkedWord[j] = true;
                }
            }
            outFile &lt;&lt; "\n";    
        }   
    }
}
</code></pre>

<p>In my python code (below), rather than having a second vector, I have a list ("words") of lists of a string, a sorted list of the chars in the former string (because strings are immutable), and a bool (that tells if the word has been checked yet). However, I can't figure out how to change a value as you iterate through a list.</p>

<pre><code>    for word, s_word, checked in words:
    if not checked:
        for word1, s_word1, checked1 in words:
            if s_word1 == s_word:
                checked1 = True # this doesn't work
                print word1,
        print ""
</code></pre>

<p>Any help on doing this or thinking more "Pythony" is appreciated.</p>
