We can use the following code to convert kilometers to Miles.
user_input = float (input ("Please enter speed in Km: "))
ratio = 0.621371
output_in_miles = user_input * ratio
print ("Speed in Miles: ", output_in_miles)
OutPut:
Please enter speed in Km: 120
Speed in Miles: 74.5645