17. Python Program to convert Kilometers into Meters and Centimeters.
How does this program work?
- In this program we can find the distance between two cities in kilometers into meters and centimeters by using Python.
- The distance between two cities is given by the user is stored in a variable.
- By using the given formula we can find the distance in meters and centimeters.
Here is the code
km = int (input("Enter the distance between two cities in kilometers: "))
mtr = (km * 1000)
cent = (km * 100000)
print("Distance between two cities in meters is: ",mtr)
print("Distance between two cities in centimeters is: ",cent)