0 votes
in Python by
What is the output of the following code?

def smart_divide(func): def wrapper(*args): a, b = args if b == 0: print('oops! cannot divide') return

    return func(*args)

return wrapper

@smart_divide def divide(a, b): return a / b

print(divide.name) print(divide(4, 16))

print(divide(8,0))

1)

smart_divide

0.25

oops! cannot divide

None

2)

wrapper

0.25

oops! cannot divide

3)

smart_divide

0.25

oops! cannot divide

4)

wrapper

0.25

oops! cannot divide   

None

1 Answer

0 votes
by

4)

wrapper

0.25

oops! cannot divide   

None

Related questions

0 votes
asked Jan 19, 2021 in Python by SakshiSharma
+1 vote
asked Jan 19, 2021 in Python by SakshiSharma
...