programming-examples/python/_Basics/Python Program to Convert Kilometers to Miles.py
2019-11-15 12:59:38 +01:00

11 lines
296 B
Python

kilometers = 5.5
# To take kilometers from the user, uncomment the code below
kilometers = input("Enter value in kilometers")
# conversion factor
conv_fac = 0.621371
# calculate miles
miles = kilometers * conv_fac
print('%0.3f kilometers is equal to %0.3f miles' %(kilometers,miles))