write program in python to calculate energy using this formula: energy = mgh
Answers
Answered by
4
//To find Mechanical Energy of a Particle
g = 9.8
m = int(input('Enter Mass of an object(Kg): '))
h = int(input('Enter displacement of an object(m): '))
v = int(input('Enter velocity of an object(m/s): '))
P = m*g*h #Potential energy(P.E = mgh)
K =0.5*m*v*v #Kinetic energy(K.E = 1/2mv^2)
M = P+K #To calculate Mechanical energy(M.E = P.E+K.E)
print("Potential Energy : " ,P,"J")
print("Kinetic Energy : " ,K,"J")
print("Total Mechanical Energy: " ,M,"J")
Similar questions