Write a Python program to convert kilometers to miles.

Write a Python program to convert kilometers to miles.

Program
def myfun():
    kilometers=float(input("Enter distance in kilometers: "))
    # Conversion factor: 1 kilometer = 0.621371 miles
    conversion_factor=0.621371
    miles=kilometers * conversion_factor
    print(kilometers," kilometers is equal to ",miles," miles "  )
if __name__=="__main__":
    myfun()


Output:

Enter distance in kilometers: 100
100.0 kilometers is equal to 62.137100000000004 miles



More Questions


60 . Write a Python program to find the area of a triangle.
61 . Write a Python program to convert kilometers to miles.
62 . Write a Python program to convert Celsius to Fahrenheit.
63 . Write a Python Program to Check if a Number is Positive, Negative or Zero.
64 . Write a Python Program to Check if a Number is Odd or Even.
65 . Write a Python Program to Check Leap Year.
66 . Write a Python Program to Check Prime Number.
67 . Write a Python Program to Print all Prime Numbers in an Interval of 1-10.
68 . Write a Python Program to Find the Factorial of a Number.
69 . Write a Python Program to Display the multiplication Table.
70 . Write a Python Program to Print the Fibonacci sequence.



For latest job updates join Telegram Channel: https://t.me/sateeshm