-->

Python Program to Convert Distance from Kilometers to Miles

Here we are writing a Python Program to Convert the distance from Kilometer to Miles.

in Some parts of the word we measure distance in Kilometers and in some parts we use Miles.If the Distance is available in kilometers and you want it in Miles then you can convert it.

The formula that we are using is Distance in Miles = Distance in Kilometers * 0.621371

distance.py

1 #Variable for Storing the distance in Kilometers
2 km = 10
3 
4 #Calculating the Distance in Miles
5 miles = km * 0.621371
6 
7 #Printing the Result
8 print('%.2f Kilometer = %0.2f Miles' %(km, miles))

Python Program to Convert Distance from Kilometer to Mile video tutorial