Exercice 1
class Personne :
def __init__(self,taille, poids , age):
[Link]=taille
[Link] =poids
[Link]=age
def IMC(self):
return ([Link] / [Link]*2)
def interpretation(self) :
if ([Link]() <=18.5):
print ("Insuffisance pondérale")
elif ([Link]()>30):
print ("obésité")
#main
x=float(input("donner taille "))
y=float(input("donner le poids "))
z=int(input("donner lage" ))
aa=Personne(x,y,z)
print([Link]())
print([Link]())
exercice 2 :
def nbre_chiffres(n) :
while ( n<0):
n = int(input("donner un entier "))
ch=str(n)
x=len (ch )
return x
def est_armstrong(n):
ch=str(n)
aux=0
for i in ch:
aux= aux+ pow(int(i),nbre_chiffres(n))
return aux
#main
print(nbre_chiffres(548834))
print(est_armstrong(548834))