Python Program Logic: Python Code Kilometers To Miles Conversion is a program to input a value in kilometers. This Python program then converts the given value of kilometers provided by the user at run time, into miles.
How to convert kilometers to miles?
Since we know that 1 kilometer is equal to 0.621371 miles:
Hence we will multiply the given kilometers by 0.621371
Kilometers To Miles Conversion Formula
miles = kilometers * 0.621371
Python Program Source Code
Sample Run Output of Kilometers to miles program
Enter value in kilometers: 125
125.0 Kilometers = 77.67 Miles
Enter value in kilometers: 10
10.0 Kilometers = 6.21 Miles
Enter value in kilometers: 55
55.0 Kilometers = 34.18 Miles
3,335 total views, 6 views today