Why do I get: Invalid Syntax
<p>I am getting invalid syntax on the following:</p>

<pre><code>rootdir = 'c://temp/test//files//'
for subdir, dirs, files in os.walk(rootdir):
    for file in files:
        fileParts = file.split('.')
        if len(fileParts) &gt; 1:
            stripper = fileParts([len(fileParts)-2]
            print(stripper)
</code></pre>
