adplus-dvertising
frame-decoration

Question

What is the output of the code shown below?
def d(f):
    def n(*args):
        return '$' + str(f(*args))
    return n
@d
def p(a, t):
    return a + a*t 
print(p(100,0))

a.

100

b.

$100

c.

$0

d.

0

Posted under Python

Answer: (b).$100

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?