0

I have created a function as below,

def first():
    print('foo')
    def second():
        print('bar')

i want to access the second() function directly so that i could print bar is there any way to do it?

hemanth30
  • 21
  • 5
  • 1
    `second` *doesn't even exist* until `first()` has been called - and it doesn't return `second` or otherwise store it anywhere that is accessible outside of the function, so there is no later opportunity to call `second()`. – jasonharper Mar 11 '20 at 17:51
  • Why do you have nested functions in the first place? – AMC Mar 11 '20 at 18:07

0 Answers0