In this programming tutorial, you will learn a simple Python program to convert kilometers to miles. Before moving ahead, make sure that you know about basic Python programming concepts such as variables, data types, and operators. You can also refer these books to learn Python programming.
Python program to convert Kilometers to Miles
As you know, 1 KM is equal to 0.621371 Miles. Therefore, to convert kilometers to miles, you just have to divide the number entered by a user by 1.609. Here is the Python source code you can refer:
#Python program to convert Kilometers to Miles KM = float(input(print("Enter Kilometer = "))) M = KM/1.60934 print("Miles = ", M)
Other Python programs for practice
- Python Program to Generate A Random Number.
- Python Program To Swap Two Numbers.
- Python Program To Solve A Quadratic Equation.
- Python Program to Calculate The Area of a Triangle.
- Python Program To Add Two Numbers.
- Python Program to Find the Square Root of A Number.
- Python Program to Print Hello World.