class Personnage: def __init__(self, nom, cat): self.nom = nom self.pdv = 20 self.exp = 1 self.cat = cat match self.cat: case "guerrier": self.inventaire = ["epee"] case "magicien": self.inventaire = ["baton"] case "voleur": self.inventaire = ["dague"] case "elfe": self.inventaire = ["arc"] self.inventaire.append("potion")