From 530355ca0c05f39afc15ec85449207e1d4cf4134 Mon Sep 17 00:00:00 2001 From: Arthur BARRAUX Date: Wed, 7 Sep 2022 12:03:33 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9but?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/main.py b/main.py index 1a96fb2..f2980f3 100644 --- a/main.py +++ b/main.py @@ -1,32 +1,17 @@ -class Personne: - def __init__(self, poids, taille, age): - self.poids = poids - self.age = age - self.taille = taille - def imc(self): - return self.poids / (self.taille / 100) ** 2 - def interpretation(self): - imc = self.imc() - if imc <= 18.5: - print("Insuffisance pondérale") - elif imc >= 30: - print("obésité") - - -class Eleve: - def __init__(self, nom, age, notes=[]): +class Personnage: + def __init__(self, nom, cat): self.nom = nom - self.age = age - self.notes = notes - - def _moyenne_(self): - try: - return sum(self.notes) / len(self.notes) - except (ZeroDivisionError): - return False - - def au_dessus(self, m_classe): - return self.moyenne() >= m_classe - + self.categories = { + "guerrier" : ["sword", "potion"], + "magicien" : ["stick", "potion"], + "thief" : ["dagger", "potion"], + "elfe" : ["bow", "potion"] + } + self.pdv = 20 + self.xp = 1 + self.cat = cat + self.inv = self.categories[self.cat] + def jet_attaque(self): + pass \ No newline at end of file