Calculate Speed from Distance and Time
E · easyP · Verified PYQmath
Problem
A car travels a fixed distance of 1000 meters. Given the time taken in seconds, calculate the speed of the car in km/hr. Formula: Speed (m/s) = Distance / Time. Convert m/s to km/hr by multiplying by (18/5).
Example
Input
50
Output
72.0
speed_ms = 1000.0 / time. speed_kmh = speed_ms \* 18/5. Print as float.
Speed = 1000/50 = 20 m/s = 20 \* 18/5 = 72.0 km/hr