Question: In Python: Write a script names ex5.2.py that: 1- Creates a custom Exception classes named OhNoNotTrueError. 2- Write code that uses your custom exception to

In Python:

Write a script names ex5.2.py that:

1- Creates a custom Exception classes named OhNoNotTrueError.

2- Write code that uses your custom exception to test all of the values in this list using a for loop and raises an OhNoNotTrueError exception if a value isnt true.

The list:

am_i_true_or_false = [ True, None, False, "True", 0, "", 8, "False", "True", "0.0" ] 

Your scripts output should look like this:

True is true. None is false False is false True is true. 0 is false is false 8 is true. False is true. True is true. 0.0 is true.

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!