syntax error on line: `if x.isupper() and not in y`
<p>I'm getting "invalid syntax" errors pointing to the "in" statement. What's my mistake?</p>

<pre><code>while(notes &gt; 1):
    note = choice(scale)
    if note[0].isupper() and not in patternNotes:
        patternNotes.append(note)
        notes -= 1

    elif note is not rootNote and note not in patternNotes:
        patternNotes.append(note)
        notes -= 1
</code></pre>
