Sail E0 Webinar
Question
What is the output of the code shown below?def f(x):    def f1(a, b):        print("hello")        if b==0:            print("NO")            return        return f(a, b)    return f1@fdef f(a, b):    return a%bf(4,0)
Options:
A .  helloNO
B .  helloZero Division Error
C .  NO
D .  hello
Answer: Option A


In the code shown above, we have used a decorator in order to avoid the Zero Division Error. Hence the output of this code is:
hello
NO



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers