Related Articles
Python Program to convert Kilometers to Miles
• Last Updated : 19 Dec, 2017

Kilometer is a unit of length in the metric system equivalent to 1000 meters.

Miles is also the unit of length equal to 1760 yards.

Example:

```Input: 5.5
Output: 3.418

Input: 6.5
Output: 4.039
```

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

Formula:

```1 kilometer equals 0.62137 miles.
Miles = kilometer * 0.62137
Kilometer = Miles / 0.62137
```

 `# Python3 program to convert ` `# kilometers to miles ` ` `  `# driver code ` `kilometers ``=` `5.5` ` `  `# conversion factor ` `conv ``=` `0.621371` ` `  `# calculate miles ` `miles ``=` `kilometers ``*` `conv ` `print``(``'%0.3f kilometers is equal to %0.3f miles'` `%``(kilometers,miles)) ` ` `  `kilometers ``=` `6.5` ` `  `# calculate miles ` `miles ``=` `kilometers ``*` `conv ` `print``(``'%0.3f kilometers is equal to %0.3f miles'` `%``(kilometers,miles)) `

Output:

```5.500 kilometers is equal to 3.418 miles
6.500 kilometers is equal to 4.039 miles
```

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :