Question: Problem 1 - simple_calc.py: Basic calculator [10 points] In the previous assignment, you wrote multiply.py, which performed only one operation. Your new program should accept

 Problem 1 - simple_calc.py: Basic calculator [10 points] In the previous

Problem 1 - simple_calc.py: Basic calculator [10 points] In the previous assignment, you wrote multiply.py, which performed only one operation. Your new program should accept three arguments, where the first and last (third) are, again, floating point numbers, and the middle (second) argument is one of +, - *, /, or . For this program, should be taken to mean exponentiation. Your program should print the result of the arithmetic operation; e.g., for program arguments . 5 +-0.5", the output of your prograrn should be If the operator argument is not (exactly) one of these five possible string values, then your program should print Invalid operator. You do not need to check for division by zero. Practice goal: Practice with simple conditionals (and if-then-else "ladders"). Further familiarization with sys.argv

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!