what's wrong with my code? countconsonant
<pre><code>def countConsonant (s):

    """Count consonants.

    'y' and 'Y' are not consonants.

    Params: s (string)
    Returns: (int) #consonants in s (either case)
    """

    # do not use a brute force solution:
    # think of a short elegant solution (mine is 5 lines long);
    # do not use lines longer than 80 characters long

    # INSERT YOUR CODE HERE, replacing 'pass'
    countConsonant = 0
    for index in s:
        if index == 'bcdfghjklmnpqrstvwxyz':
            countConsonant += 1
    return countConsonant 

print (countConsonant ('"Carpe diem", every day.')) # should return 8
</code></pre>

<p><code>==</code> checks for equality, and that's probably not what you want. You have to use the <code>in</code> operator to check membership, and in this case membership of a character in a string. It follows this general syntax:</p>

<pre><code>if x in y:
</code></pre>

<p>Where <code>x</code> is the operand or the one being checked if membership is present in <code>y</code>. Applying that to this case, replace your <code>if</code> statement to this:</p>

<pre><code>if index in 'bcdfghjklmnpqrstvwxyz':
</code></pre>

<p>This will then check if the certain character is in the given consonant string. Also, one thing to note, you only check lower case. That means <code>C</code> in <code>Carpe diem</code> is ignored giving the result of 9. To ignore case try:</p>

<pre><code>if index.lower() in 'bcdfghjklmnpqrstvwxyz':
</code></pre>

<p>This will make the string lowercase when checking.</p>

python