Skip to content

Instantly share code, notes, and snippets.

@BedirYilmaz
Created October 23, 2016 11:06
Show Gist options
  • Save BedirYilmaz/38406dd425a0ff9f3e8aff7ff0cd63a8 to your computer and use it in GitHub Desktop.
Save BedirYilmaz/38406dd425a0ff9f3e8aff7ff0cd63a8 to your computer and use it in GitHub Desktop.
Find out the pythagorian triplet that has sides that has to 1000 as product
def issquarepyth(a,b,c):
return (a*a + b*b) == c*c
def issumok(a,b,c):
return (a+b+c) == 1000
def findTriplet():
a=0
b=0
c=0
while True:
for b in range(0, c):
for a in range(0, b):
if(issquarepyth(a,b,c) and issumok(a,b,c)):
return a*b*c
c += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment