Examlex

Solved

The Following Is a Program Segment and the Definition of a Function

question 12

Short Answer

The following is a program segment and the definition of a function named sub.
X=8˙ def sub():  sub() x˙=2 print (X).\begin{array} { l c } \mathrm { X } = \dot { 8 } & \text { def sub(): } \\\text { sub() } & \dot { \mathrm { x } } = 2 \\\text { print } ( \mathrm { X } ) & \cdot \\. & \cdot\end{array}
A. What value will be printed by the program segment if X of function sub is a global variable?
___________
B. What value will be printed by the program segment if X of function sub is a local variable?
___________


Definitions:

Fast Mapping

A process by which children learn new words after only a brief encounter, connecting it with their own mental categories.

Logical Extension

A strategy children use to increase their vocabulary in which they extend a new word to other objects in the same category.

False Belief Tasks

Are cognitive exercises used primarily in developmental psychology to assess an individual's understanding that others can hold beliefs different from reality.

Egocentric Problem Solvers

A characteristic of early childhood cognitive development where individuals can only see situations from their own perspective.

Related Questions