nerdexam
GIAC

GPYC · Question #40

What is the output of the following line of code typed into a Python interactive session? student@573:$ cat question.py b = some_func() a = b + 10 print(a) def some_func(): return 5 student@573:$…

The correct answer is A. NameError: name 'some_func' is not defined. You've hit your limit · resets 1pm (America/New_York)

Python Fundamentals & Command Line Tools

Question

What is the output of the following line of code typed into a Python interactive session? student@573:$ cat question.py b = some_func() a = b + 10 print(a) def some_func(): return 5 student@573:$ python question.py

Options

  • ANameError: name 'some_func' is not defined
  • B5
  • C5+10
  • D15

How the community answered

(62 responses)
  • A
    90% (56)
  • B
    5% (3)
  • C
    2% (1)
  • D
    3% (2)

Explanation

You've hit your limit · resets 1pm (America/New_York)

Topics

#function definition order#NameError#Python execution#module scope

Community Discussion

No community discussion yet for this question.

Full GPYC Practice