Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sides = []
- count = 0
- while count < 3:
- x = input("Enter length of triangles: ")
- if not x.isdigit() or not float(x) >= 1:
- print(f"It's impossible to create Pythagorean Triples with a non-positive integer {x}")
- exit()
- sides.append(int(x))
- count += 1
- sides.sort()
- if sides[0]**2 + sides[1]**2 == sides[2]**2:
- print("The sides {},{}, and {} are Pythagorean Triples".format(*sides))
- else:
- print("The sides {}, {}, and {} are not Pythagorean Triples".format(*sides))
Add Comment
Please, Sign In to add comment