Skip to content

Commit 247f1b7

Browse files
authored
created sol1.py
1 parent 7f87515 commit 247f1b7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: Project Euler/Problem 9/sol1.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Program to find the product of a,b,c which are Pythagorean Triplet that satisfice the following:
2+
# 1. a < b < c
3+
# 2. a**2 + b**2 = c**2
4+
# 3. a + b + c = 1000
5+
6+
print("Please Wait...")
7+
for a in range(300):
8+
for b in range(400):
9+
for c in range(500):
10+
if(a < b < c):
11+
if((a**2) + (b**2) == (c**2)):
12+
if((a+b+c) == 1000):
13+
print("Product of",a,"*",b,"*",c,"=",(a*b*c))
14+
break

0 commit comments

Comments
 (0)