Editor settings

General settings

Save settings

Learn to program with Python

Convert kilometers to miles #

Write a Python function that converts distance measurements in kilometers to miles. The function should take a distance value in kilometers as input and return the equivalent distance in miles.

To get an approximate result for this challenge, divide kilometers with 1.609 to get the length in miles.


Tests #

  • convert_km_to_mi(0) should return a value of 0
  • convert_km_to_mi(10) should return a value of 6.215040397762586
  • convert_km_to_mi(20) should return a value of 6.215040397762586
Output will be displayed here