This is the text written in a text file. I want to delete specific lines for example from line no. 2 to 4 and write the rest as it is on the txt file.
Q.A ladder placed against a wall such that it reaches the top of the wall of height 6 m and the ladder is inclined at an angle of 60 degree. Find how far the ladder is from the foot of the wall. Ans.3.464 m Ans.exp.: We will use trigonmetry to solve the problem easily and quickly. Here AB represents height of the wall, BC represents the distance between the wall and the foot of the ladder and AC represents the length of the ladder. In the right triangle ABC, the side which is opposite to angle 60 degree is known as opposite side (AB), the side which is opposite to 90 degree is called hypotenuse side (AC) and remaining side is called adjacent side (BC). Now, we need to find the distance between foot of the ladder and the wall. That is, we have to find the length of BC.
I have opened the file in python and assigned the lines as follows:
with open('Maths.txt') as f:
lines = f.read().split('\n')
How should I proceeed further?