Write a method Inverse that asks the user for a number and displays the inverse of that number.
For example, the inverse of 2 is 1/2 or 0.5 and the inverse of 3 is 1/3 or 0.333.
If the program encounters an error because the user put something other than numbers, it raises an exception and prints “Please enter a number”.
If it encounters an error because they put zero for the denominator, it raises another exception and prints “Can’t divide by zero.”
Sample output:>>> Inverse()Enter a number: 2Its inverse is 0.5Enter a number: FivePlease enter a numberEnter a number: 0Can't divide by zero
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here