Your question is Crossing Time Math Puzzle. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A J.P. Morgan operations dashboard needs to estimate how long a moving train takes to pass a fixed signal pole. Given the train's length in meters and speed in kilometers per hour, calculate the crossing time in seconds.
A train crosses a pole when its entire length has passed the pole. Therefore, the distance traveled is exactly the train's length.
Implement train_crossing_time(length_meters, speed_kmh). Return the crossing time as a floating-point number of seconds. Do not round the result.
Convert the speed from kilometers per hour to meters per second before applying:
time = distance / speed
def train_crossing_time(length_meters, speed_kmh):