Unit 2 Vocabulary

  • Bits: The smallest unit of data that a computer can use and store. Bits are in the state of either 0(off) or 1(on).
  • Bytes: Data units that are eight binary digits long. These are used to simulate characters, numbers, or symbols.
  • Hexadecimal: A system using the base of 16 and using the digits 0-9 and the letters A-F to simulate data.
  • Nibbles: Data units that are four binary digits long. These are used to simulate characters, numbers, or symbols. Known as half-bytes.
  • Binary Numbers: 0 and 1. 0 represents false or off and 1 represents true or on.
  • Unsigned Integer: Integers that will always be positive in a 32 bit data list. This includes the value 0.
  • Signed Integer: Integers that can be positive or negative in a 32 bit data list.
  • Floating Point: A positive or negative number with a decimal point.
  • Binary Data Abstractions: Reducing a body of data to a simplified form represented using the values of one and zero.
  • Boolean: A statement that results in either true or false.
  • ASCII: The most commonly used character encoding format for text data. Uses 1 byte to represent characters.
  • Unicode: The universal character encoding standard. Uses 4 bytes to represent characters.
  • RGB: The system used to represent color that will be displayed.
  • Data Compression: The process of modifying data with the purpose to reduce the data’s size.
  • Lossy Compression: The process of removing data in a file and not restoring it after decompression.
  • Lossless: The process of restoring or rebuilding data in a file after decompression.

Unit 3 Vocabulary

  • Variables: Abstractions that represent values.
  • Data Types: The value(s) in a variable. They can be numbers, Booleans, lists, and strings.
  • Assignment Operators: Operators that assign a value(Data Types) to other values or variables.
Var = 5
# 'Var' is the variable
# '=' is the Assignment Operators
# '5' is the Data
  • Lists: Collections of data that can store unlimited amounts of data and can be called by some functions.
  • 2D Lists: Lists that are stored in another list. Acts like a subgroup.
  • Dictionaries: An abstract data type that holds a collection of data at a set of values.
  • Class: A command that makes objects for code.
List = [[1, 2, 3], 4, 5
]
# 'List' is the list
# 'List[0] is the 2D list
  • Algorithms: Sets of instructions that are used to accomplish a task.
  • Sequence: the order in which the commands in the code are executed in.
  • Selection: The process that determines which parts of an algorithm is being executed based on a condition that is true or false.
var = 5                     # Algorithms is this entire code
print(var)                  # Sequence is the order of print statements
if var % 2 == 0:            # 'if else' is selection
    print("reminder is 0")
else:
    print("reminder is 1")
5
reminder is 1
  • Iteration: Repetition in a program that allows for code to repeat itself a set amount of times.
  • Iteration Expressions: Expressions used to cause repetition. These expressions cause what is normally called loops.
  • Comparison Operators: Operators that compare numbers or strings to perform an analysis.
progress = 0                    # Iteration Expression: 'while loop'
while progress < 10:            # Comparison Operator: '<'
    progress = progress + 1     
    print(progress)
1
2
3
4
5
6
7
8
9
10
  • Boolean Expressions: Expressions that result in true or false.
  • Boolean Selection: The process of using true or false values to select data.
Good = True
Bad = False
GoodorBad = Good            # Boolean Expressions
if GoodorBad == True:       # Boolean Selection
    print("Good")
else:
    print("Bad")
Good
  • Truth Tables: Tables that are used to map out the possible true values of something and to determine the resulting outcomes.
  • Characters: A unit that displays information related to a letter or a symbol.
  • strings: A data type that collects and stores a sequence of elements that are also characters.
  • Length: The width of a collection of data.
  • Concatenation: The process of joining multiple elements together.
List = ["a", "b", "c", "d", "e"       #List of Characters
]                                     #Lenght of List printed and counted by the index count.
print("length is " + str(len(List)))  #str is string that makes len(list) act like a character.
print(List[0] + List[2] + List[4])    #Concatenation happening because of the assignment operator '+'.
length is 5
ace
  • Upper Traversing Strings: The process of doing something to each string one at a time going from beginning to end.
  • Lower Traversing Strings: The process of doing something to each string one at a time going from the end to the beginning.
List = ["a", "b", "c", "d", "e"       
]
i = 0
while i < len(List):                #Upper Traversing String
    print(List[i])
    i = i + 1

r = len(List) - 1
while r >= 0:                      #Lower Traversing String
    print(List[r])
    r = r - 1
a
b
c
d
e
e
d
c
b
a
  • If, Elif, Else conditionals: statements that have different choices that will execute based on a condition in the code.
  • Nested Selection Statements: If, Elif, Else conditionals placed in other If, Elif, Else conditionals.
score = 400
todayhighscore = 300
highscore = 600
if score > todayhighscore:         #-----------------------------
    if score > highscore:           #--
        print("New Highscore!")       #Nested Selection
    else:                             #Statement                If, Else Statement
        print("New Daily Highscore!")#--
else:
    print("Better Luck Next Time") #-----------------------------
New Daily Highscore!
  • Python For loop with Range: For loops ran using the command “for ‘value’ in ‘range(#-#)’.” Used to apply something to a 0 certain range of values.
  • Python For loop with List: For loops ran using the command “for ‘item’ in ‘list’.” Used to apply something to certain items in a list one by one.
  • Python While loops with Range: While loops ran using the command “While ‘value’ ‘Assignment Operators’ ‘range(#-#)’.” Used to apply something to a certain range of values.
  • Python While loops with List: While loops ran using the command “While ‘item’ ‘Assignment Operators’ ‘(len)list’.” Used to apply something to certain items in a list one by one.
List = [ 0, 1, 2, 3, 4, 5
]
for i in range(0, 6):     #For loop with range
    print(i)
print("-----")
for i in List:            #For loop with List
    print(str(List[i]))
print("-----")
i = 0                     #While Loop with range
while i < 6:
    print(i)
    i = i + 1
print("-----")
i = 0                     #While Loop with List
while i < len(List):
    print(i)
    i = i + 1
0
1
2
3
4
5
-----
0
1
2
3
4
5
-----
0
1
2
3
4
5
-----
0
1
2
3
4
5
  • Combining loops with conditionals to Break: A looping command affected by a conditional or multiple conditionals that is stopped in its tracks by a break command.
  • Combining loops with conditionals to Continue: A command that returns the “flow” back to the beginning of a while loop. This results in skipping a check.
List = ["a", "b", "c", "d", "e"]
for i in List:
    if i == "c":
        break               #Combining loops with conditionals to Break
    print(i)
print("-----")
for i in List:
    if i == "c":
        continue           #Combining loops with conditionals to Continue
    print(i)
a
b
-----
a
b
d
e
  • Procedural Abstraction: A process that allows a procedure to be used knowing only what it does. This makes the code flexible for different situations and parameters.
  • Python Def procedures: A group of instructions in a function that may have parameters and return values.
  • Parameters: input values used in a procedure.
  • Return Values: Values that a function returns to the function when it finishes.
def addingnum(num):         #Def procedures     #'num' is a Parameter
    return num + 12         #Return Value

sum = addingnum(6)          #Procedural Abstraction
print(sum)
18