zuai-logo

Glossary

A

Assignment

Criticality: 3

The process of giving a variable a value for the first time. In many programming languages, this is done using an assignment operator like `=`.

Example:

When you write player_name = "Alice", you are performing an assignment, giving the player_name variable the value "Alice".

B

Booleans (bool)

Criticality: 3

A data type that represents truth values, holding either `True` or `False`. They are fundamental for conditional logic and decision-making in programs.

Example:

In a game, a variable is_game_over might be set to True when the player loses all their lives, triggering the end screen.

D

Data types

Criticality: 3

Categories that classify the kind of value a variable can hold. They determine what operations can be performed on the data.

Example:

Understanding data types helps you know that you can add two numbers together, but you can't directly add a number to a word.

F

Floats (float)

Criticality: 2

A numerical data type used to store numbers that have a decimal point. They are used for values that require fractional precision.

Example:

A temperature reading like 98.6 degrees Fahrenheit or a price like $19.99 would be stored as a float.

I

Integers (int)

Criticality: 2

A numerical data type used to store whole numbers, including positive numbers, negative numbers, and zero, without any decimal points.

Example:

The number of students in a class, like 25, would be stored as an integer because you can't have half a student.

L

Lists (list)

Criticality: 2

An ordered collection of items, which can include elements of different data types. They are mutable, meaning their contents can be changed after creation.

Example:

A shopping cart containing ["milk", "eggs", "bread"] is a list of items, and you can add or remove items from it.

R

Reassignment

Criticality: 3

The act of changing the value of an already existing variable. The variable will then hold the new value, overwriting its previous content.

Example:

If lives = 3 initially, and then later lives = lives - 1 is executed, this is a reassignment that updates the lives variable to 2.

S

Strings (str)

Criticality: 2

A data type used to store sequences of characters, such as letters, words, numbers, or symbols. They are typically enclosed in quotation marks.

Example:

Your name, "Alex Johnson", or a message like "Game Over!" are examples of strings.

V

Variable

Criticality: 3

A named storage location in a computer's memory that holds a value. It acts as a container for data that can be used and manipulated within a program.

Example:

In a game, score could be a variable that stores the player's current points, starting at 0 and increasing as they play.