QuestionQ52

VerifiedPython Basics

What output results from entering the following code in a Python interactive session?

Question Image

Explanation

Python binds a function name only when its def statement executes. Because some_func() is called before that definition is reached, some_func is undefined and execution raises a NameError.

Community Discussion

No comments yet. Be the first to start the discussion!