Python

Distance Converter

Converts a value between mile and kilometer units

This program shows the use of functions.

Two functions convert numbers between kilometer and meter. Additionally the program will get the current units and value, and return the resulting conversion.

Example:

> python dist_conv.py

> This program converts between miles and kilometers

> Enter M for miles or K for kilometers followed by

> a space and the distance value to convert ie (M 32)

> is 32 miles

> k 100

> 100.0 kilometers is 62.1 miles