[solved]-Write Python Program Defines Function Named Dividetwonumbers Accepts Two Numeric Parameter Q39071219
Write a Python program which defines a function named”divide_two_numbers” that accepts two numeric parameters anddivides the first parameter by the second. Your divide_two_numbersfunction must check the second parameter before dividing; if it iszero, raise an ZeroDivisionError exception which includes thestring “second parameter was zero!” as a parameter instead ofprocessing the division. Your main function must call yourdivide_two_numbers function at least twice; one call must use twonormal parameters to verify normal operation, the other call mustuse zero as the second parameter to test your exception code. Thesecalls must be enclosed in a try/except block to handle theZeroDivisionError exception and print the string parameter if theexception is raised. Sample Output: 5 divided by 2 is 2.5 Error:second parameter was zero! Here is how I called mydivide_two_numbers function from my main function, using 5 and 2for the first call, followed by 5 and 0 for the second: print(“5divided by 2 is ” + str(divide_two_numbers(5, 2))) print(“5 dividedby 0 is ” + str(divide_two_numbers(5, 0)))
Expert Answer
Answer to Write a Python program which defines a function named “divide_two_numbers” that accepts two numeric parameters and divid… . . .
OR

