A Program to Convert Kilometers to Miles
In this example, we are giving a program to convert kilometers to miles.
Program to convert kilometers to miles:
# Convert kilometers to miles
km = float(input('Enter value in kilometers: '))
convert_num = 0.621371
miles = km * convert_num
print('%0.2f kilometers is equal to %0.2f miles'%(km,miles))
Output:
Enter value in kilometers: 9 9.00 kilometers is equal to 5.59 miles