free fall python

Solutions on MaxInterview for free fall python by the best coders in the world

showing results for - "free fall python"
Hilary
13 Jun 2020
1import math
2
3height = int(input('Enter height by meters: '))
4mass = input('Enter mass by kg: ')
5
6g = 9.8
7
8time = float(math.sqrt(2*height/g))
9vel1 = float(math.sqrt(2*height*g))
10vel2 = float(vel1*3.6)
11energy = int(mass)*0.5*(vel1**2)
12
13print(f'Time until impact: {round(time, 3)} seconds')
14print(f'Speed at impact: {round(vel2,3)} km/h or {round(vel1, 3)} m/s')
15print(f'Energy at impact: {round(energy, 3)} joules')
16