Computer Science
Name three run-time errors that occur during Python program execution.
Related Questions
What all can be the possible outputs of the following code?
def myfunc (x=None) : result = "" if x is None: result = "No argument given" elif x == 0: result = "Zero" elif 0 < x <= 3: result = "x is between 0 and 3" else: result = "x is more than 3" return result c = myfunc (3.5) print (c)
List the situation(s) in which the following errors occur:
(a) IOError
(b) NameError
(c) ValueError
(d) TypeError
What is the difference between an error and exception?
How can you handle an exception in Python? Write sample code to illustrate it.