Unit 3.1: Variables and Assignments
- Variables are abstractions within programs which represent a value
- Values can be individual data points or a list/collection that contains many data values
- Types of data: numbers, Booleans (T/F), lists, and strings
Python
To define variables, just establish a variable name, and then use the equal sign to set it equal to a value, wheter it be a string, character, list, or boolean.
Javascript
global variables can be defined with the var
keyword
Constant variables could be defined with the const
keyword
Local variables could be defined with the let
keyword.
Unit 3.2: Data Abstraction
- A list is made up of elements organized in a specific order
- An element is a unique, individual value in a list
- A string differs from a list as it is a sequence of characters rather than elements
- Data abstraction uses a list by taking specific data elements from a list and organizing into a whole, less complex representation of the values such as a table
Python
In python, lists could be used to organize similar data structures.
Lists could be split with the .split()
method. The deliminator
for the splitting operation could be set within the parenthesis. By default, the deliminator are whitespace characters.
Lists could also be joined into a variable with the .join()
method. A deliminator could also be set for such a list.
###