None in the output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

None in the output

text = input() def uppercase_decorator(func): def wrapper(): print('###') func() print('###') return wrapper @uppercase_decorator def display_text(): print(text.upper()) print(display_text()); Whi is "None" in the output?

17th May 2021, 11:02 AM
Александр Грамович
Александр Грамович - avatar
1 Answer
+ 2
because display_text() doesnt return anything and you called print on it. Having None as a return value, it prints the decorater because it was called, and then prints the return value: None just call the method https://code.sololearn.com/c6LlmlriUAZi/?ref=app
17th May 2021, 11:07 AM
Slick
Slick - avatar