Question: CAN YOU HELP ME WITH THIS ASSIGNMENT? THIS IS PYTHON PROGRAMMING LANGUAGE Write a Python program that does the following: Accepts user-entered inputs for 2
CAN YOU HELP ME WITH THIS ASSIGNMENT? THIS IS PYTHON PROGRAMMING LANGUAGE
Write a Python program that does the following:
Accepts user-entered inputs for 2 numbers. These can include negative numbers or floating point numbers.
Prompts the user to enter one of the following string literals for a mathematical calculation:
sqrt - for square root of both numbers
exp - raises the first number to the power of the second number, e.g. N1^N2
avg - calculates the average value of both numbers
mod - modulo, calculates the remainder of N1 / N2
fact - calculates the factorial of the integer components of both numbers.
Provides graceful exception handling when:
Invalid numbers are entered.
An invalid operation is chosen.
The math operation results in an invalid outcome, such as division by zero, square root of a negative number, factorial of negative integer, etc.
HINT - explore the Python math library for ways to perform these calculations.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
