| about | help | code help+videos | done | prefs |
A Pythagorean triplet is a set of three numbers [a, b, c], that could represent the length of the sides of a right triangle, so that a**2 + b**2 == c**2. We will agree to always write the triplets with a <= b <= c, and we will only consider positive integer-lengthed sides. Write the function pythag(p) which finds a Pythagorean triplet with perimeter p (the perimeter is a+b+c) or returns False if there is no such triplet. pythag(11) → False pythag(12) → [3, 4, 5] pythag(13) → False ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250 Post-solution available
Copyright Nick Parlante 2017 - privacy