Codecademy Logo

Basics of Programming I

Data Type Definition

In programming, data types are how computers classify different forms of information. They include numeric, string and boolean types.

For example, if using number data type, the program will know that arithmetic can be performed on it, but it can’t be capitalized.

Numbers definition

In programming, numbers are a common data type. They represent numerical values and can include numbers with and without decimal points.

-25
0
.68888
7039

String Definition

In programming, strings are a common data type. They are any sequence of characters (letters, spaces, numbers, or symbols) surrounded by single or double quotes. Strings are commonly used to represent text, speech, symbols, and other non-numerical characters.

"Hello world"
"Great work!"

Booleans Definition

In programming, booleans are a common data type. They represent the logical ideas of true and false.

AND Operator

In programming, the logical AND operator (&&) compares two values. It returns true when both values evaluate to true and false otherwise.

The following evaluates to true: grass is green AND fire is red 2 > 1 AND 6 > 5 3 == 3 AND 8 == 8

While this evaluates to false: trees are large AND ant are massive 5 < 4 AND 6 > 3 7 == 7 AND 0 == 9

Variable Definition

In programming, variables are used to assign a name to a piece of data and to use that name to reference the data elsewhere in the program.

myName = 'Zoe'

Variable Declaration

In programming, variables are declared by giving it a name and setting it to a value using an equals sign (‘=’). Variables can later be reassigned to other values.

dogBreed = 'corgi'

Learn More on Codecademy