0

So I have a program that at its core is this

def first():
    global myvar
    myvar = "thing"
        def second():
            print myvar

but when it runs nothing happens, I honestly dont know what else to do

1
  • 1
    So you define a function and then what? I don't know python but don't you need to call the function at some point? Commented Mar 14, 2017 at 3:45

1 Answer 1

1
def first():
    global myvar
    myvar = "thing"
    def second():
        print myvar
    second()  #==>call the function or
    return second()  #return the second function

first()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.