Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started