Week 3 - data types Flashcards
Characteristics of the compound data type - List?
A list is a collection which is ordered, changeable and allows duplicates.
Held inside [ ].
Characteristics of the compound data type - Tuple?
A tuple is a collection that is ordered and unchangeable. Allows duplicates. Held inside ( )
Characteristics of the compound data type - Dictionary?
A dictionary is a collection which is not ordered, changeable and indexed. No duplicates allowed.
Held inside { }
Contains a key:value - the value is assigned to the key.
Characteristics of the compound data type - Sets?
A set is a collection which is NOT ordered or indexed.
No duplicates allowed, once created the set can not be changed, but can be added to.
Held inside { }
What is the syntax used when calling any value in a data collection/array?
[ ] - square brackets
variable[1]
What is Imperative programming
Imperative programming uses statements to change the programs state.
Flexible, but more complex.
Focuses on how the program receives the result.
What does x == y translate as?
x is equal to y
What does x != y translate as?
x does not equal y
What does x > y mean?
x is greater than y
What does x < y mean?
x is less than y
What does x >= y mean?
x is greater than or equal to y
What does x <= y mean?
x is less than or equal to y
What does AND do?
Used as a condition and it means that both conditions should be meet.
The program will stop after the first false.
What does OR do?
Used as a condition and it means that either condition could be meet.
The program will stop after the first true.
What is abstraction?
This is a key concept in object orientated programming.
It’s main goal is to handle complexity by hiding unnecessary detail from the user to implement more complex logic on top of the provided abstraction.
This can be done without understanding or even thinking about all the hidden complexity.