Question: PYTHON: Write a program that creates an exception class called NumberOutOfRangeException (derived from RuntimeError), designed to be thrown when a number is discovered that has
PYTHON: Write a program that creates an exception class called NumberOutOfRangeException (derived from RuntimeError), designed to be thrown when a number is discovered that has a value x not in range 1000 < x < 2000. In the main driver of the program, read number from the user until the user enters -1000. If a number is entered that is not in the range, throw the exception. Allow the thrown exception to terminate the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
