Codele / Programming basics
Values and their types
A computer can hold three kinds of thing: numbers, text and true-or-false. The kind matters, because it decides what a plus sign does.
- A computer holds three main kinds of value: numbers, text and true or false.
- Text goes in quotes. Programmers call it a string. A true-or-false value is a boolean.
- 5 and “5” are different. 5 + 5 makes 10, but “5” + “5” makes “55”.
- Quotes are a label, not part of the text. Printing “Mia” shows Mia.
- The kind of a value decides what operations make sense on it.
Loading the playable lesson…