def makebold(fn):
def wrapped():
return "<b>" + fn() + "</b>"
return wrapped
def message():
return "TasPython Guide"
message = makebold(message)
print(message())
Well, I have many questions about the above code...
1st: why inside the wrapped() function we use the fn variable as a function? Shouldn't we use fn instead of fn() ?
2nd: why message = makebold(message)
and not message = makebold(message())
3rd: why print(message())
gives me this result???
I would expect something like: print(makebold(message())
Thank you guys!