I personally like doing this with sets. For example:
opts = ["associé", "gérant", "président", "directeur"]
if set(opts) & set(gender):
...
& is used for the set intersection operation which returns a new set with the items shared by the sets on either side of the &. This will execute the if block only if there is overlap in gender and opts. You can repeat the process for your elif as well, creating a list of the possible options and checking for overlap between that list and gender. All together, you could do something like this:
male_opts = ["associé", "gérant", "président", "directeur"]
female_opts = ["associée", "gérante", "présidente", "directrice"]
if set(male_opts) & set(gender):
gen = "male"
elif set(female_opts) & set(gender):
gen = "female"
else:
gen = "error"
Also, as @Copperfield points out. You could increase efficiency even more by making the *_opt variables (and potentially even gender sets to begin with:
male_opts = {"associé", "gérant", "président", "directeur"}
female_opts = {"associée", "gérante", "présidente", "directrice"}
gender = set(gender)
if male_opts & gender:
...
Edit:
The code above assumes that gender is an iterable, but it seems from the comments that it is a string instead (e.g., 'associé gérant'. Although the accepted answer is better at this point, you could still use this solution by making gender a set of the words that make up the string:
gender = set(gender.split())
in? What are possible values forgender?associéfor ex is not a gender. What is a gender in your code?