From e78df380dc6233e79c5946b81fdc2d27a8222791 Mon Sep 17 00:00:00 2001 From: bleu-lotuz Date: Wed, 16 Oct 2024 22:23:19 -0700 Subject: [PATCH] his is Python implementation of Pythagoras theorem algorithm. This is Python implementation of Pythagoras theorem algorithm. This takes the two values of the sides of a right triangle and returns the hypotenuse --- geometry/.pythagoras_triplet.py.swp | Bin 0 -> 12288 bytes geometry/pythagoras_triplet.py | 29 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 geometry/.pythagoras_triplet.py.swp create mode 100644 geometry/pythagoras_triplet.py diff --git a/geometry/.pythagoras_triplet.py.swp b/geometry/.pythagoras_triplet.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..a4dccf76db638fd5cb4b8a19578380eaa661fe19 GIT binary patch literal 12288 zcmeI2&2G~`5XZONKoqKSt~8iSQb^LK7iuXzAU+R8Rn;Oc)Y>K++tl81*K4X=-~i&l zL+}P1-~kYi!6TFlAmGS>S=(tU)B+W!O0&w}yPNgQ&i=+ZSefmG2lrNCxxFB$%?R<~ z^-Q=wS{JWg3h{V^Hp;bhOMhzjl}hA}Ol2bT)~f8^K-_7q8Ehxmm&wHP>DXcCCiaU| zX`6TM#P)8n-B}yi2z4h^m?~>Vos8x(L?iRSnm9|8ZD*s2Cmt~YCU9~B(_*Q+SpL+n zc$eYQ?B>Z`umuxf0!)AjFaajO1egF5U;?L>fX$}FGm8F9eS*2VpZcw@r`$0CCcp%k z025#WOn?b60Vco%m;e)C0;iCG90>8~ybzyA?*ISs`~T02LcAlrCA}a$ByE!BNwcIM z7limq`a=3l`bc_DdQRFP`J`pibNN-3HDI@{O?Z5A0;Kl@)025#W zOn?b60Vco%m;e*_UjjfaGqJXfBWsJt<;IOX9;n4@;JR+JDJEv#Z8T|-NWdXPqYSOm zMXmsPE0FI>qrf0qw^(}E>cZ8^$yV2E(mM{d(kJv_n4q+cSZ9T8c(=4w25h9tWw3kb ze7L!Z!^i@aKT91Z%BzDZz5m4tYIVGmGL!-Kt;%iNT~Zu0>ImaBLt~*{74Z;)K+9AG z0rYy{1wkrf9R!|F*>ERv%_v(KeF%vtzoyF}NfGC)`G;myWP=Mdp-dGSr1k zz|o0y2&T|}Z3V4#j0ajzj&XtJV2^*feZA0S!fWg~?8Owfdjy73 u6z4!630Xl;-CB7VcgjS$l6q-l)Z^^C#j1=RHmWjuvP-D0o;FBJ7QX float: + hypotenuse = sqrt(side1**2 + side2**2) + return hypotenuse + + +if __name__ == "__main__": + import doctest + + doctest.testmod() + + side1 = float(input("Enter the side one of the right triangle")) + side2 = float(input("Enter the side two of the right triangle")) + + print("Formula of hypotenuse => sqare root of side1^2 + side2^2") + print(pythagoras_triplet.pythagoras(side1, side2))