← Back to challenges

Rectangle in Circle

PythonHardmathvalidationgeometry

Instructions

Create a function that takes three numbers — the width and height of a rectangle, and the radius of a circle — and returns True if the rectangle can fit inside the circle, False if it can't.

Examples

rectangle_in_circle(8, 6, 5) ➞ True

rectangle_in_circle(5, 9, 5) ➞ False

rectangle_in_circle(4, 7, 4) ➞ False

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Reversible Inclusive List Ranges