Problem 173275 · easy · Phase 01 Prerequisites & Setup

Miles to Kilometres

functions · arithmetic · unit conversion · rounding

Write to_km(miles) that converts a distance in miles to kilometres. One mile is exactly 1.609344 km. Return the result rounded to 2 decimal places.

Examples

Input:  miles = 10
Output: 16.09
Input:  miles = 26.2
Output: 42.16

Constraints

  • -10**6 <= miles <= 10**6

Goals

  • Return a value from a function instead of printing it
  • Round a float to two decimal places with round()
Starting Python…