Question: 2. Calling an implemented Python function stored in a Module by using import statement a) Re-write the python program math_function1.py from MathoperationProject and rename it


2. Calling an implemented Python function stored in a Module by using import statement a) Re-write the python program math_function1.py from MathoperationProject and rename it as math, main function. py Include all the defined value-return functions called do Add, do_Subtract, do_Product, and do_Divide within a module called mathoperation.py Define a void method named main that allows end user to input and calls the defined functions do Add, do Subtract, do Product and do Divide within a module called math_main function1.py as shown in Figure 9 b) What is the difference between the following program shown in Figure 9 and the program of Figure 5? PY Project def main() : 4math eample2.py print (sE nunberi-int (imput('Enter the value of variable numberi: nunber2-int (input ('Enter the value of variable number2 ration.do A4d(numbe print ('The sn or,nunberi, and', number2, is' co CaLL of the function separate noduler 15 1e 17 print ('The prodact of,nunberi and,nunber2, total total- athoperation.do Divide (nunberl, nunber) print ('The division of'. ..r1, -by." t2, 'Ls', total) 19 20 maino Rure python.eeC/M0 Mankato The variable deciaration and assignment Enter the value ot variable nunberl: 6 Enter the value of variable nunber2: 8 the an of and is 14 The subtract of and 6 1s-2 The product of 6 and 19 4 The division of 6by&s 0.75 c) Rewrite the Python program of (math_function2.py) of Figure 6 which allows the end user to evaluate four functions fl(x), f2(x, z), f3(z, t), f4(y,t) Include all the defined value-return functions called evaluate f1, evaluate f2, evaluate f3, and evaluate f4 within a module called mathFunction.py Define a void method named main that allows end user to input and calls the defined functions evaluate_f1, evaluate f2, evaluate f3, and evaluate f4 within a module called math_main function2.py as shown in Figure 10 2. Calling an implemented Python function stored in a Module by using import statement a) Re-write the python program math_function1.py from MathoperationProject and rename it as math, main function. py Include all the defined value-return functions called do Add, do_Subtract, do_Product, and do_Divide within a module called mathoperation.py Define a void method named main that allows end user to input and calls the defined functions do Add, do Subtract, do Product and do Divide within a module called math_main function1.py as shown in Figure 9 b) What is the difference between the following program shown in Figure 9 and the program of Figure 5? PY Project def main() : 4math eample2.py print (sE nunberi-int (imput('Enter the value of variable numberi: nunber2-int (input ('Enter the value of variable number2 ration.do A4d(numbe print ('The sn or,nunberi, and', number2, is' co CaLL of the function separate noduler 15 1e 17 print ('The prodact of,nunberi and,nunber2, total total- athoperation.do Divide (nunberl, nunber) print ('The division of'. ..r1, -by." t2, 'Ls', total) 19 20 maino Rure python.eeC/M0 Mankato The variable deciaration and assignment Enter the value ot variable nunberl: 6 Enter the value of variable nunber2: 8 the an of and is 14 The subtract of and 6 1s-2 The product of 6 and 19 4 The division of 6by&s 0.75 c) Rewrite the Python program of (math_function2.py) of Figure 6 which allows the end user to evaluate four functions fl(x), f2(x, z), f3(z, t), f4(y,t) Include all the defined value-return functions called evaluate f1, evaluate f2, evaluate f3, and evaluate f4 within a module called mathFunction.py Define a void method named main that allows end user to input and calls the defined functions evaluate_f1, evaluate f2, evaluate f3, and evaluate f4 within a module called math_main function2.py as shown in Figure 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
