Right Triangle Checker¶
Write a program to allow the user to enter three integers. You
must use pre-test or post-test while
loops to enforce that these integers are in ascending order,
though duplicate numbers are allowed.
Tell the user whether or not these integers would represent the sides of a right triangle.
Name the file: right_triangle_checker.py
Enter three integers:
Side 1: 4
Side 2: 3
3 is smaller than 4. Try again.
Side 2: -9
-9 is smaller than 4. Try again.
Side 2: 5
Side 3: 1
1 is smaller than 5. Try again.
Side 3: 5
Your three sides are 4 5 5
NO! These sides do not make a right triangle!
Enter three integers:
Side 1: 6
Side 2: 8
Side 3: 10
Your three sides are 6 8 10
These sides *do* make a right triangle. Yippy-skippy!
©2021 Daniel Gallo
This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Adapted for Python from Graham Mitchell’s Programming By Doing