Answers for "free fall python"

4

free fall python

import math

height = int(input('Enter height by meters: '))
mass = input('Enter mass by kg: ')

g = 9.8

time = float(math.sqrt(2*height/g))
vel1 = float(math.sqrt(2*height*g))
vel2 = float(vel1*3.6)
energy = int(mass)*0.5*(vel1**2)

print(f'Time until impact: {round(time, 3)} seconds')
print(f'Speed at impact: {round(vel2,3)} km/h or {round(vel1, 3)} m/s')
print(f'Energy at impact: {round(energy, 3)} joules')
Posted by: Guest on August-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language