Fiveable
Fiveable

Variables

Definition

Variables are named storage locations in computer memory that hold values which can be changed during program execution.

Analogy

Think of variables as containers with labels. You can put different things inside these containers (values), and you can change what's inside them whenever you want.

Related terms

Data Types: Data types define what kind of data can be stored in a variable, such as integers, strings, or booleans.

Assignment Operator (=): The assignment operator is used to assign a value to a variable.

Scope: Scope refers to the visibility and accessibility of variables within different parts of your code.



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.