+ 1

Pardon my ignorance but How could I get the wrap function to wrap each letter?

def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): a = "Hello world!" for i in a: print(i) decorated = decor(print_text) decorated()

11th Feb 2022, 7:47 PM
Israel Romario Soares
Israel Romario Soares - avatar
2 Answers
+ 2
def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): a = "Hello world!" print(a) decorated = decor(print_text) decorated() """ or do you trying this ? Israel Romario Soares def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): print(i) a = "Hello world!" decorated = decor(print_text) for i in a : decorated() """
11th Feb 2022, 7:55 PM
Jayakrishna 🇼🇳
+ 1
Jayakrishna🇼🇳 thanks much. đŸ‘đŸŸ
11th Feb 2022, 8:20 PM
Israel Romario Soares
Israel Romario Soares - avatar