Python Program to convert kilometer to mile

Program

kilometers = float(input("Enter value in kilometers:\n"))
conv_fac = 0.621371
miles = kilometers * conv_fac
print('%3.2f kilometers is equal to %3.4f miles' %(kilometers,miles))

Output

Enter value in kilometers:
76
76.00 kilometers is equal to 47.2242 miles

Tags: