# Python 3 Program to Convert Kilometres to Miles

This Python programming tutorial will teach you a simple Python 3 program to convert kilometers to miles. Before moving ahead, make sure you know about basic Python programming concepts such as variables, data types, and operators. If you love books, check out these best books to learn Python programming.

## Python 3 Program To Convert Kilometers to Miles

As you know, 1 KM is equal to 0.621371 Miles. Therefore, to convert kilometers to miles, you have to divide the number entered by a user by 1.609.

Here is the Python source code you can refer to:

```#Python program to convert Kilometers to Miles
KM = float(input(print("Enter Kilometer = ")))
M = KM/1.60934
print("Miles = ", M)```

## Python 3 Program to Convert Miles to Kilometers

1 mile is equal to 1.60934 KMs. Therefore, to convert miles to kilometers, you have to multiply the value by 1.60934.

Code:

```def convertMilestoKm(value):
value = value * 1.60934
return value

MilesInput = float(input(print("Enter Miles: ")))
KM = convertMilestoKm(MilesInput)
print("Kilometers = ", KM)```

Output:

Enter Miles: 2
Kilometers = 3.21868

Scroll to Top