From 247f1b736b895510daa54a516a81b5f711335379 Mon Sep 17 00:00:00 2001 From: Thejus-Paul <32426070+Thejus-Paul@users.noreply.github.com> Date: Thu, 9 Nov 2017 02:58:05 +0530 Subject: [PATCH] created sol1.py --- Project Euler/Problem 9/sol1.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Project Euler/Problem 9/sol1.py diff --git a/Project Euler/Problem 9/sol1.py b/Project Euler/Problem 9/sol1.py new file mode 100644 index 000000000..ed8a2ab36 --- /dev/null +++ b/Project Euler/Problem 9/sol1.py @@ -0,0 +1,14 @@ +# Program to find the product of a,b,c which are Pythagorean Triplet that satisfice the following: +# 1. a < b < c +# 2. a**2 + b**2 = c**2 +# 3. a + b + c = 1000 + +print("Please Wait...") +for a in range(300): + for b in range(400): + for c in range(500): + if(a < b < c): + if((a**2) + (b**2) == (c**2)): + if((a+b+c) == 1000): + print("Product of",a,"*",b,"*",c,"=",(a*b*c)) + break