Introduction to Variables

In computer science, data is everything. But how do we store it? Meet the Variable.

1. What is a Variable?

Think of a variable as a labeled box in a warehouse.

Common Data Types

String

Text data. Always surrounded by quotes.

"Hello World"

Integer / Number

Whole numbers or decimals used for math.

42 or 3.14

Boolean

Logic data. Only two possible values.

true or false

2. Quick Review

Identify the data type of the value shown below:

"Cybersecurity"

3. The Variable Lab

Instructions: Use the console below to declare a variable. Give it a name and a value. The system will analyze your input, determine the Data Type, and allocate it to "memory."

System Memory Visualization:

Memory is empty...