Question: The next three questions are based on the following code. Suppose you have the following in a Jupyter Notebook code chunk: CONSTANT = 12345 def

The next three questions are based on the following code.

Suppose you have the following in a Jupyter Notebook code chunk:

CONSTANT = 12345 def foo(a): # SOME LOGIC (detail not shown) def bar(b): # SOME LOGIC (detail not shown) def baz(c): # SOME LOGIC (detail not shown)

1. SELECT ALL THAT APPLY: Which of the following functions can have access to the CONSTANT variable defined in line 1?

a. Any functions in the current Jupyter Notebooks stored in the same directory

b. bar

c. foo

d. Any additional function you define in the same Jupyter Notebook

e. baz

2. SELECT ALL THAT APPLY: Which of the following variables is/are local variable(s)?

"Local" is equivalent to "NOT global".

a. foo

b. CONSTANT

c. .globalenv

d. b

e. bar

f. baz

g. a

h. c

3. SELECT ALL THAT APPLY: The parameter b can definitely be accessed by which of the following?

a. Any other function(s) defined in the scope of baz

b. baz

c. CONSTANT

d. Any other functions in Jupyter Notebooks stored in the same directory as the current.

e. Any other function(s) defined in the scope of bar

f. Any other function(s) defined in the scope of foo

g. bar

h. foo

i. Any other functions in this Jupyter Notebook

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!