Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

~~~MUST PROGRAM IN PYTHON~~~ (Conversions between feet and meters) Write a modul

ID: 638153 • Letter: #

Question

~~~MUST PROGRAM IN PYTHON~~~

(Conversions between feet and meters) Write a module that contains the following
two functions:
# Converts from feet to meters
def footToMeter(foot):
# Converts from meters to feet
def meterToFoot(meter):
The formulas for the conversion are:
foot = meter / 0.305
meter = 0.305 * foot
Write a test program that invokes these functions to display the following tables:
Feet Meters | Meters Feet
1.0 0.305 | 20.0 66.574
2.0 0.610 | 26.0 81.967
...
9.0 2.745 | 60.0 196.721
10.0 3.050 | 66.0 213.115

OUTPUT:

>>>

Explanation / Answer

To make things work as you want, you must treat the units conversion and the printing problem separately. Your conversion functions should only return the converted value. Then you can deal with the printing and formatting on another code block or function.

Here is the code that should work as you expect, using string formatting for a better result: