Unit 3.1 and 3.2 Notes
Unit 3.1 Variables and Assignments
-
Variables are abstractions that represent values.
- Values can be single data points or a list that has many data values.
- Data can be numbers, Booleans, lists, and strings.
-
Python
- Variables are defined by one word and uses the = sign to set that word equal to an inserted value.
- Those variables are defined through numbers, string, list, or boolean based on its purpose.
- Mathematical Expressions can be used if the variable is a number.
- Functions can be used if list is defined.
- Dictionaries can be used like lists but not exactly.
- Variables work in many functions and conditions.
- Variables can interchange by setting the value of a variable to the value of another variable.
- To define a function, use the varable "def".
-
JavaScript
- JavaScript has similar functions compared to python.
- JavaScript Uses . . .
- Numbers
- Booleans
- Strings
- Lists
Unit 3.2 Data Abstraction
- A list is made of elements placed in a certain order.
- An element is a single value in a list
- A string is different from a list because a string is made of characters and letters.
-
Data abstraction takes certain data elements from a list and puts them in one less complex representation of values. An example would be putting the data elements in a table.
-
Python
- To Data abstract, lists are great in python. It allows formatting information to be easier and results in fewer mistakes.
- Lists can be broken into more lists by having the data elements labeled in different groups and those groups put into a new list.
- Single elements can be called uponed and seprated from the rest of the list.
- "split()" splits a string into a list.
- "join()" brings lists together into one string.