In [1]:
kilometers = float(input("Please enter distance in kilometers : "))
miles = kilometers * 0.621371
print("Distance in miles =", miles)
Here, we asked the user to input the distance in kilometers. One kilometer is equal to 0.621371 miles, so multiplied kilometers with 0.621371 and printed the distance in miles.