Unit conversion program (Using Python)
This program will demonstrate how to create and use modules. Wewill use modules to convert from inches to meters and from metersto inches. It will demonstrate how to define functions withinmodules and how to import the module functions in otherprogram.
InputProcessingOutput
menuSelection
dimension
If menuSelection is 1
Convert from meters to inches
Else if menuSelection is 2
Convert from inches to meters
Else
exit
Dimension in converted units
DIRECTIONS:
- Open IDLE and start a new file
- Safe the file under name converter.py
- Create to functions in the file for unit coversion:
def meterToInch(metricValue):
return metricValue * 100 /2.54
def inchToMeter(inchValue):
return inchValue *2.54 /100
- Start new file
- From
OROR