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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started