Написать класс Triangle, моделирующий треугольник

   1 Tri = Triangle(3,4,5), Triangle(5,4,3), Triangle(7,1,1), Triangle(5,5,5), Triangle(7,4,4)
   2 for a,b in zip(Tri[:-1],Tri[1:]):
   3     print(a if a else b)
   4     print("{}={:.2f} {}={:.2f}".format(a, abs(a), b, abs(b)))
   5     print(a == b)
   6     print(a >= b)
   7     print(a < b)

3.0:4.0:5.0
3.0:4.0:5.0=6.00 5.0:4.0:3.0=6.00
True
True
False
5.0:4.0:3.0
5.0:4.0:3.0=6.00 7.0:1.0:1.0=0.00
False
True
False
5.0:5.0:5.0
7.0:1.0:1.0=0.00 5.0:5.0:5.0=10.83
False
False
True
5.0:5.0:5.0
5.0:5.0:5.0=10.83 7.0:4.0:4.0=6.78
False
True
False


CategoryHomework

LecturesCMC/PythonIntro2017/Homework_TrianglesCmp (last edited 2017-11-20 06:07:34 by FrBrGeorge)