Find a more efficient way to code an If statement in python
<p>it's the second time I'm confronted to this kind of code : </p>

<pre><code>    if "associÃ©" in gender or "gÃ©rant" in gender or "prÃ©sident" in gender or "directeur" in gender:
    gen = "male"
elif "associÃ©e" in gender or "gÃ©rante" in gender or "prÃ©sidente" in gender or "directrice" in gender:
    gen = "female"
else:
    gen = "error"
</code></pre>

<p>I'd like to find a more efficient way to write this code because it looks really bad. </p>

<p>Using lists and <code>any</code>:</p>

<pre><code>males = ["associÃ©", "gÃ©rant", "prÃ©sident", "directeur"]
females = ["associÃ©e", "gÃ©rante", "prÃ©sidente", "directrice"]

if any(m in gender for m in males):
    gen = "male"
elif any(m in gender for m in females):
    gen = "female"
else:
    gen = "Error"
</code></pre>

python if-statement