Problem 192925 · easy · Level 01 Prerequisites & Setup

Average Speed in km/h

functions · unit conversion · arithmetic · rounding

A running app records a distance in metres and a time in seconds. Write average_speed(metres, seconds) returning the average speed in kilometres per hour, rounded to 1 decimal place.

Examples

Input:  metres = 1000, seconds = 240
Output: 15.0
Input:  metres = 100, seconds = 9.58
Output: 37.6

Constraints

  • 0 <= metres <= 10**7, 0 < seconds <= 10**6

Goals

  • Convert metres to kilometres and seconds to hours
  • Divide the converted values and round to one decimal
Starting Python…