Python Program to Convert Kilometer (km) to Meter (m)

Kilometer is a unit of length in international system of units. It is denoted by km.

1km is equivalent to 1000 meters. So, to convert kilometer to meter; we need to multiply the length value in kilometer by 1000.

This Python program converts value given in kilometer to meter.

Python Source Code: Kilometer to Meter


# Python program to convert km to m

# Reading input
km = input("Enter distance in kilometer: ")

# Converting to float data type
km = float(km)

# Converting to meter
m = km * 1000;

# Displaying output
print("%0.3f Kilometer = %0.3f Meter" %(km,m))

Output

The output of the above program is:

Enter distance in kilometer: 5.436
5.436 Kilometer = 5436.000 Meter