### Instruction: A train covers a distance of 12 km in 10 min. If it takes 15 sec to pass a telegraph post, then the length of the train is?
Answer Choices: (A) 300 m (B) 168 m (C) 120 m (D) 168 m (E) 178 m Please write a program to solve it.### Response: distance = 12  # distance covered by the train in km
time = 10 / 60  # time taken by the train in hours
speed = distance / time  # calculate the speed of the train in km/h
speed_mps = speed * 1000 / 3600  # convert speed to m/s
time_to_pass_post = 15  # time taken by the train to pass the post in seconds
length = speed_mps * time_to_pass_post  # calculate the length of the train in meters
print(length)