Awesome-Python-Scripts
Awesome-Python-Scripts copied to clipboard
adding Depth_of_lake.py
Adding a Python program that calculates the following depth of lake problem. Issue#181
Description: While sailing on a boat, Rose noticed a beautiful water lily flower above the lake's surface. She came closer and it turned out that the lily was exactly H centimeters above the water surface. Rose grabbed the flower and sailed the distance of L centimeters. Exactly at this point the flower touched the water surface.
Suppose that the lily grows at some point A on the lake bottom, and its stem is always a straight segment with one endpoint at point A. Also suppose that initially the flower was exactly above the point A, i.e. its stem was vertical. Can you determine the depth of the lake at point A?
Expected Input and output given:
Input : H and L (1<=H<L) Output: Depth of Lake at Point A
Eg: Input: 1 2 Output: 1.5
Hi @SubhalakshmiK, Thanks for your contribution. Please follow our Contribution Guidelines.