0
How can I print 'a' value ?
def f1(func): func() print(func.a) def f2(): a=10 print('hi') f1(f2)
2 Réponses
0
Jay Matthews
How can I print a value from another function
https://code.sololearn.com/ck2UxKMtCMQd/?ref=app
0
As far i know that's Not possible. You need pass value and use it to print.
def f1(func):
func()
print('hi')
def f2():
a=10
print(a)
f1(f2)
def f1(func):
print ( func() )
print('hi')
def f2():
a=10
return a
f1(f2)