Cheatsheets / Learn How to Code
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 -25
represent numerical values and can include numbers with
0
and without decimal points.
.68888
7039
String Definition
In programming, strings are a common data type. They "Hello world"
are any sequence of characters (letters, spaces, numbers,
"Great work!"
or symbols) surrounded by single or double quotes.
Strings are commonly used to represent text, speech,
symbols, and other non-numerical characters.
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 myName = 'Zoe'
piece of data and to use that name to reference the data
elsewhere in the program.
Variable Declaration
In programming, variables are declared by giving it a name dogBreed = 'corgi'
and setting it to a value using an equals sign (‘=’). Variables
can later be reassigned to other values.
Print Share