Write a python program to determine the length of ladder required to reach a given height when leaned against the house . the height and the angle of the ladder are given as inputs (use math library)
import math
height = float(input("Enter the height to be reached (in meters): "))
angle_degrees = float(input("Enter the angle of the ladder with the ground (in degrees): "))
angle_radians = math.radians(angle_degrees)
length = height / math.sin(angle_radians)
print(f"The length of the ladder needed is: {length:.2f} meters")
Comments
Post a Comment