Python ProgrammingPython Programming

Calculate free fall velocity of an object

Write a program that determines the speed or velocity of an object is traveling when it hits the ground. The program will read the height in meters (m) from which user dropped the object. Assume that the acceleration due to gravity is 9.8m/s2.
#Python's program to calculate the speed of an object when it hits the ground after being dropped.

from math import sqrt

#Define the constant
GRAVITY = 9.8	

#Read the input from user
height	= float(input("Height from which object is dropped (in meters): "))

#Calculate the velocity
velocity = sqrt(2 * GRAVITY * height)

#Display the result
print("Object will hit the ground at %.2f m/s." % velocity)
Sample output of above program.
Height from which object is dropped (in meters): 100
Object will hit the ground at 44.27 m/s.