Create a library with functions to input the values with exception handling in Python
belongs to collection: Python Exception Handling Programs
All Answers
total answers (1)
belongs to collection: Python Exception Handling Programs
total answers (1)
Here, we are creating a Python library "MyLib.py" with two functions,
When we input the values other than integer/float the ValueError will occur, this error is also being handled in the functions.
Then, we are creating a main file "Main.py", where we are reading and printing the values.
MyLib.py:
Main.py:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer