Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NEED HELP ASAP PLEASE!!! Should be done in Python! SUBMISSION INSTRUCTIONS Submit 2 python files using the naming convention below (replace JaneDoe with your first
NEED HELP ASAP PLEASE!!! Should be done in Python!
SUBMISSION INSTRUCTIONS Submit 2 python files using the naming convention below (replace JaneDoe with your first and last name respectively): - formulas.py - JaneDoe3_1.py QUESTION 1. Create a module named formulas that contains the functions below: a. def add(values): This function should return the sum of all the numbers in the list values. b. def subtract(values): This function should return the difference of all the numbers in the list values. c. def multiply(values): This function should return the product of all the numbers in the list values. d. def divide(values): This function should return the result of dividing all the numbers in the list values. If the first number is 0 the result should be 0 but if any of the other numbers are 0 , use the sys.exit method to stop the program and display the exit message Cannot divide by 0 . SAMPLE OUTPUT Need to provide the operator name PS C: \Users\Owora\Desktop\Python> python JaneDoe3_1.py add Need to provide at least two values PS C: \Users\Owora\Desktop\Python> python JaneDoe3_1.py add 12 Answer =3.00 PS C: \Users\Owora\Desktop\Python> python JaneDoe3_1.py subtract 123 Answer =4.00 Answer =0.00 Answer =0.50 Answer =0.00 PS C: \Users\Owora\Desktop\Python> python JaneDoe3_1.py divide 1002 Cannot divide by 0 PS C: \Users\Owora\Desktop\Python> python JaneDoe3_1.py divide 1023 Answer =1.67 PS C: \Users\Owora\Desktop\Python> python JaneDoe3_1.py test 234 Valid operator names (add, subtract, multiply, divide)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started