Menu

Working Properly Program Functions Import Convertmf Convertfm Def Main Length Input Enter Q43780063

The total is 649 3. Create a custom Python module named functions.py. This module must contain two functions: one that conver

Here is what I have and it is not working properly:

program:

from functions import (convertmf, convertfm)

def main():
length = (input(‘Enter the length to convert: ‘))
choice = (input(‘Enter M or F to convert enterted value to Metersor Feet: ‘))
if choice==F:
print(‘The length’, length,’Meters convertsto’,functions.convertmf(choice),’Feet.’,format(length,convertmf,’.2f’))
elif choice==M:
print(‘The length’, length, ‘Feet convertsto’,functions.convertfm(choice),’Feet.’,format(length,convertfm,’.2f’))
else:
print(‘Error: invalid selection.’)

main()

functions:

#the formula for converting feet to meters is feet =meters/0.3048
#the formula for converting meters to feet is meters= feet *0.3048

def convertmf(choice):
return length*0.3048

def convertfm(choice):
return length/0.3048

The total is 649 3. Create a custom Python module named functions.py. This module must contain two functions: one that converts from Feet to Meters and one that converts from Meters to Feet. These functions must be named convertmf (used when Fis selected) and convertfm ( used when M is selected). Write a program named program53.py, which imports the functions from module functions.py. The program’s main() should prompt the user to specify M or Fas choices then call the appropriate function which was imported. Conversion accuracy should use full precision ( 5 decimal places ) for the calculations, and display then print the result to two decimal places. Enter the length to convert: 25.75 Enter Mor F to convert enterted value to Meters or Feet: M The length 25.75 Feet converts to 7.85 Meters. Enter the length to convert: 25.75 Enter M or F to convert enterted value to Meters or Feet: F The length 25.75 Meters converts to 84.48 Feet. Tip: Use the import keyword: import functions from * . The call the functions, would be functionname() Show transcribed image text The total is 649 3. Create a custom Python module named functions.py. This module must contain two functions: one that converts from Feet to Meters and one that converts from Meters to Feet. These functions must be named convertmf (used when Fis selected) and convertfm ( used when M is selected). Write a program named program53.py, which imports the functions from module functions.py. The program’s main() should prompt the user to specify M or Fas choices then call the appropriate function which was imported. Conversion accuracy should use full precision ( 5 decimal places ) for the calculations, and display then print the result to two decimal places. Enter the length to convert: 25.75 Enter Mor F to convert enterted value to Meters or Feet: M The length 25.75 Feet converts to 7.85 Meters. Enter the length to convert: 25.75 Enter M or F to convert enterted value to Meters or Feet: F The length 25.75 Meters converts to 84.48 Feet. Tip: Use the import keyword: import functions from * . The call the functions, would be functionname()

Expert Answer


Answer to Here is what I have and it is not working properly: program: from functions import (convertmf, convertfm) def main(): le…

OR