Exercise #1: Pythagorean Triples
For this exercise we are going use python to solve for Pythagorean triples. For those that are not familiar, a little background.
In a right triangle there exists a strict relationship between the 3 sides. A right triangle with sides a, b and hypoteneuse c maintains this relationship:
This picture describes it.
A Pythagorean triple consists of three positive integers a, b, and c, such that a2+b2=c2
. Such a triple is commonly written (a, b, c), and a well-known example is (3, 4, 5).
Add a code cell for each triple below and solve for the missing side using the Pythagorean theorem.
- (5, ,13)
- (8,15, )
- ( ,21,29)
- (12,35, )
- ( ,40,41)