Comment se séparer d'un charteur spécifique tfrm la fin de la chaîne

print x.rpartition('-')[0]
Inquisitive Ibex