Computer Science, asked by asifali786109, 6 months ago

[3]
Q 3:(a) Find and write the output of the following python code:
def message():
Msgl="WEICOME"
Msg2="GuEsTS"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg 1 [I]>="A" and Msg1|}<="M":
Msg3=Msg3+Msg1 U
elif Msg10>= N and Msgll}<="Z"
Msg3=Msg3+Msg2001
else:
Msg3=Msg3+***
print(Msg3)
message()
(b) Write a method in python to read lines from a text file MYNOTES.TXT, and display those
lines, which are starting with an alphabet "K".
OR​

Answers

Answered by Anonymous
2

Answer:

Answer is C.

Potential energy is energy stored in an object. This energy has the potential to do work. Gravity gives potential energy to an object. This potential energy is a result of gravity pulling downwards. The gravitational constant, g, is the acceleration of an object due to gravity. This acceleration is about 10 meters per second on earth. The formula for potential energy due to gravity is PE = mgh. As the object gets closer to the ground, its potential energy decreases while its kinetic energy increases.

In this case, a body of mass 5 kg kept at a height of 10 m. So the potential energy is given as 5 * 10 *10 = 500 J.

Hence, the potential energy of a body of mass 5 kg kept at a height of 10 m is 500 J.

Similar questions