You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
402 B
23 lines
402 B
2 years ago
|
a = 1
|
||
|
b = 1
|
||
|
c = 1
|
||
|
|
||
|
def is_pythag(a, b, c):
|
||
|
return a < b < c and a**2 + b**2 == c**2
|
||
|
|
||
|
|
||
|
for a in range(1, 1000):
|
||
|
for b in range(1, 1000):
|
||
|
for c in range(1, 1000):
|
||
|
|
||
|
if c % 100 == 0:
|
||
|
print(f"iter {a} {b} {c}", end="\r")
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if is_pythag(a, b, c) and a+b+c==1000:
|
||
|
print(f"a {a} b {b} c {c}")
|
||
|
else:
|
||
|
continue
|