+ 1
Problem with decorator function in python
The function returns the expected string but also None, why? text = input() def uppercase_decorator(func): def wrapper(text): text=text.upper() func(text) return wrapper @uppercase_decorator def display_text(text): print(text) print(display_text(text))
3 ответов
+ 1
Thanks a lot!
+ 1
Thanks for the enlightenment!
0
Try this - it worked for me:
#your code goes here
return func(text.upper())
return wrapper