擅长:python、mysql、java
<pre><code>print len(set(w.lower() for w in open('filename.dat').read().split()))
</code></pre>
<blockquote>
<p>Reads the entire file into memory, splits it into words using
whitespace, converts
each word to lower case, creates a (unique) set from the lowercase words, counts them
and prints the output</p>
</blockquote>