0

How can I print 'a' value ?

def f1(func): func() print(func.a) def f2(): a=10 print('hi') f1(f2)

30th Aug 2022, 5:04 AM
Levi
Levi - avatar
2 Answers
0
Jay Matthews How can I print a value from another function https://code.sololearn.com/ck2UxKMtCMQd/?ref=app
30th Aug 2022, 5:49 AM
Levi
Levi - avatar
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)
30th Aug 2022, 3:11 PM
Jayakrishna 🇼🇳