adplus-dvertising
frame-decoration

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
@f
def f(a, b):
    return a%b
f(4,0)

a.

hello
NO

b.

hello
Zero Division Error

c.

NO

d.

hello

Posted under Python

Answer: (a).hello
NO

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the code shown below?