Code.org Computer Science Discoveries Practice Test

Access More Questions
Which term means any valid unit of code that resolves to a value?
Correct Answer:
Expression
Explanation:
An expression is any valid unit of code that evaluates to a value. This includes simple values like 7 or true, variables like x, or more complex combinations such as x + 3 or max(a, b) * 2. The key idea is that expressions are things the computer can compute to produce a value, which is different from actions that don’t yield a value. Boolean refers to a data type for true/false, which is a kind of value an expression can produce but isn’t itself the unit of code that resolves to a value. Frame isn’t a standard term for a unit of code, and Abstraction is about hiding details to manage complexity, not a code unit that yields a value. So the best fit for “any valid unit of code that resolves to a value” is the expression.

Access more questions from this quiz

Continue to Code.org Computer Science Discoveries Practice Test for more practice questions and the full quiz experience.

Access More Questions