1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| # -*- coding:Utf-8 -*-
# Écrire un programme qui teste si un triangle est constructible ainsi que sa qualité.
a,b,c=int(raw_input("Entrez trois longueurs : ") # Entrée et assignation des trois longueurs
if (a==0) or (b==0) or (c==0):
print "Ce triangle ne peut exister."
elif (a==b) and (b==c):
print "Ce triangle est équilatéral."
elif (a==b) or (a==c) or (b==c):
print "Ce triangle est isocèle"
if (a**2==b**2+c**2) or (b**2==a**2+c**2) or (c**2==a**2+b**2):
print "et rectangle"
print "."
elif ((a**2==b**2+c**2) or (b**2==a**2+c**2) or (c**2==a**2b**2)) and (not((a==b) or (a==c) or (b==c))): # Sinon
print "Ce triangle est rectangle."
else:
"Ce triangle est quelconque." |