Browse Source

début

master
Arthur BARRAUX 2 years ago
parent
commit
530355ca0c
  1. 43
      main.py

43
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): class Personnage:
imc = self.imc() def __init__(self, nom, cat):
if imc <= 18.5:
print("Insuffisance pondérale")
elif imc >= 30:
print("obésité")
class Eleve:
def __init__(self, nom, age, notes=[]):
self.nom = nom self.nom = nom
self.age = age self.categories = {
self.notes = notes "guerrier" : ["sword", "potion"],
"magicien" : ["stick", "potion"],
def _moyenne_(self): "thief" : ["dagger", "potion"],
try: "elfe" : ["bow", "potion"]
return sum(self.notes) / len(self.notes) }
except (ZeroDivisionError): self.pdv = 20
return False self.xp = 1
self.cat = cat
def au_dessus(self, m_classe): self.inv = self.categories[self.cat]
return self.moyenne() >= m_classe def jet_attaque(self):
pass
Loading…
Cancel
Save