how to remove the same words in the paragraph

Tim Chase python.list at tim.thechases.com
Wed Nov 4 10:09:12 EST 2009


>   Can we use inp_paragraph.count(iter_word) to make it simple ?

It would work, but the performance will drop off sharply as the 
length of the paragraph grows, and you'd still have to keep track 
of which words you already printed so you can correctly print the 
first one.  So you might as well not bother with counting.

-tkc





More information about the Python-list mailing list