Arthur BARRAUX
2 years ago
1 changed files with 14 additions and 29 deletions
@ -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 |
Loading…
Reference in new issue