+ 1
Why no output?
def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): print("Hello world!") print_text = decor(print_text) print_text()
4 Answers
+ 7
Both codes should give the same output. Could you save the former and the latter to different SoloLearn entries and check?
0
And why this one has output???
_____________________________
def decor(func):
    def wrap():
        print("============")
        func()
        print("============")
    return wrap
@decor
def print_text():
    print("Hello world!")
print_text();
0
it's magic, now they both works, but yesterday the first one didn't
0
I need help with a similar problem:
text = input()
def uppercase_decorator(func):
    def wrapper(t):
        #your code goes here
        t = t.upper()
        func(t)
    return wrapper
    
@uppercase_decorator    
def display_text(text):
    return(text)
    
print(display_text(text))





