+ 3

Please find what problem here?

def d(f): def wra(): return 'yo '+f().upper() return wra def d1(f): def wra(): return 'ye '+f().title() return wra def h(): return 'hi' v=d1(d(h())) print(v) #in output it giving me function memory address. but i want real function output what i need to change can you tell me.

18th Sep 2018, 5:24 PM
Maninder $ingh
Maninder $ingh - avatar
2 Antworten
+ 2
print(v) will just print the function name. You need to add parentheses to actually execute the function and print the return value: print(v()) Also, h() returns a string. d() takes the return value of h() as an argument and tries to execute it (f()). So it will try to execute a string. Here you need to remove the ().
18th Sep 2018, 6:37 PM
Anna
Anna - avatar
0
i dont happen to see the value "f" defined by a variable
19th Sep 2018, 11:10 AM
Lodwar_hayes
Lodwar_hayes - avatar