GUVI
Back

Error in exception handling 

Created 2 years ago
34 Views
1 Comments
GokilaE
@GokilaE
GokilaE
@GokilaEProfile is locked. Login
def fun(a , b):
    try:
        c = ((a+b) / (a-b))
    except logicError:
        print ("a/b result in 0")
    else:
        print (c)
 
fun(4.0, 6.0)
fun(6.0, 6.0)

in <module>fun(6.0, 6.0)
except logicError:
NameError: name 'logicError' is not defined

I am getting a logicError in that above exception handling program. I need help in this program.

Comments
Please login to comment.
 
Powered by habitate.io Habitate