Unit 2 Vocabulary Terms

Bits, Bytes, Hexadecimal / Nibbles

  • Bits - A given byte contains either bits or a code. A designation of 'bits' means that each individual bit has its own meaning, independent of the meaning of other bits in the byte.
  • Byte - code is computer object code that an interpreter converts into binary machine code so it can be read by a computer's hardware processor.
  • Hexadecimal - relating to or using a system of numerical notation that has 16 rather than 10 as its base.
  • Nibble - a nibble is four consecutive binary digits or half of an 8-bit byte.

Unsigned Integer, Signed Integer, Floating Point

  • Unsigned Integer - Unsigned Integers (often called "uints") are just like integers (whole numbers) but have the property that they don't have a + or - sign associated with them
  • Signed Integer - A signed integer is a 32-bit datum that encodes an integer in the range [-2147483648 to 2147483647].
  • Floating Point - There are two floating point primitive types. Data type float is sometimes called "single-precision floating point". Data type double has twice as many bits and is sometimes called "double-precision floating point".

Binary Data Abstractions: Boolean, ASCII, Unicode, RGB

  • Boolean - True or False statements
  • ASCII - ASCII (American Standard Code for Information Interchange) is the most common character encoding format for text data in computers and on the internet.
  • Unicode - an international encoding standard for use with different languages and scripts, by which each letter, digit, or symbol is assigned a unique numeric value that applies across different platforms and programs.
  • RGB - Red Green Blue (Gamer)

Data Compression: Lossy, Lossless (note discussed yet)

  • Lossy - Lossy is a data encoding and compression technique that deliberately discards some data in the compression process.
  • Lossless - With lossless compression, every bit of data originally in a file remains after it is uncompressed, and all the information is restored

Unit 2 Vocabulary Terms

Unit 3 Vocabulary Terms

  • Variables: A variable is an abstraction made inside a program that holds a value. These variables are used in code to refer to more complex values that the variable contains and makes the program code more organized and smoother to run.
  • Data Types: Variables have different data types that store specific kinds of data depending on what is being represented. Some examples are shown below:
    • integer (numbers)
    • string (or text/letters)
    • Boolean (True/False statements)
  • Assignment Operators: Collegeboard uses <– as the assignment operator. The assignment operator looks different for different types of coding languages A variable will take the most recent value assigned
  • Lists: Lists are sequences of elements with each element being a variable. An example of a list can be the names of the students in this classroom.
  • 2D Lists: A two-dimensional list can be considered as a matrix where each row can have different lengths and supports different data types.
  • Dictionary: Dictionaries are used to store data values in key:value pairs. A dictionary is a collection which is ordered*, changeable and do not allow duplicates.
  • Class: a class is a template definition of the method s and variable s in a particular kind of object
  • Algorithms: An algorithm is a finite set of instructions that accomplish a task, it can be expressed by natural language, diagrams, and various other ways.
  • Sequence: The order that the steps go in of a Algorithm
  • Selection: A selection allows an algorithm to make a decision based on if a condition is met. It's like a boolean True or False statement or a set of options that will determine the next step.
  • Iteration: An iteration is a loop and doing something again until a condition is met, like how something will continue to be checked for each item in a list until a condition is met.
  • Expressions: An expression in Python is a combination of operators and operands. It is like an equation or something that defines a variable's value.
  • Comparison Operators: Signs like < and > and = that compare the values of variables and other things to determine the next step in their algorithm.
  • Booleans Expressions and Selection: Based on the Boolean's True or False, it will make a selection
  • Booleans Expressions and Iteration: Based on the Boolean's True or False, it will iterate something in the algorithm or not.
  • Truth Tables: A truth table has one column for each input variable (for example, p and q), and one final column showing all of the possible results of the logical operation that the table represents.
  • Characters: Alternatively referred to as the character set, charset, and character encoding, a character code describes a specific encoding for characters as defined in the code page.
  • Strings: Basically just text, but it can be something like a sentence, not just a single letter or word.
  • Length: Determines the length of a string or a list or a variable or whatever the length of x is.
  • Concatenation: returns a single string consisting of str1 followed by str 2 (concat(str1,str2))
  • Upper and Lower Definitions: A top-code for a variable is an upper limit on all published values of that variable. Any value greater than this upper limit is replaced by the upper limit or is not published on the micro-data file at all. Similarly, a bottom-code is a lower limit on all published values for a variable.
  • Traversing Strings: String Traversal. Traversing a string. Traversing just means to process every character in a string, usually from left end to right end.
  • Python Conditionals:
    • if: If something is equal or not equal to or meets this conditional: do this
    • elif: if the following if statements do not meet the conditions, try this statement instead.
    • Else: if something meets the conditionals do this, otherwise do this (else). (if this is 1 say Hello, Else say goodbye)
    • Nested Conditionals: It's like another conditional for if else statements, where if it does this, do it, else: if this... else that.
      x = 3
      y = 2
      if x = y
        print("x = y")
      else:
        if x < y:
            print("x < y")
        else:
            print("x > y")
      
  • Python For, While loops with Range, with list
    • For: The for statement can help access every single definition in the list. For example, if I had a list that had multiple values and I wanted each thing to be evaluated by my code, I would use the for item. Example Below.
      listA = [2, 3, 4, 5, 6, 100]
      for item in listA:
        if item >= 5:
            print("Greater than 5")
        else:
            print("Less than 5")
      
    • While Loops with Range: While basically just means that "while the thing that you are assessing meets this condition, keep doing it until it doesn't". Range is simply used to define how many times you want something to repeat.
    • Lists: The two things above can be used with lists. Again, to reiterate, the for function is basically used to assess every value in the less rather than just a single variable at a time because lists can hold multiple values and the for and while functions work to help the user.
  • Break: The Break function is basically where you want to create a loop that follow the code, unless it does this, then break or in other words, stop the code.
  • Continue: Similar to the break function, the continue does the exactly opposite, where if you want the code to stop, but then once another condition is met, you can use continue to continue running the code. Example will be below:
    for i in range (1,40):
      if i == 20:
          break
      print(i)
    
  • Procedural Abstraction: Procedural abstraction is when we write code sections (called "procedures" or in Java, "static methods") which are generalized by having variable parameters. The idea is that we have code which can cope with a variety of different situations, depending on how its parameters are set when it is called.
  • Python Def Procedures: . A procedure allows us to group a block of code under a name, known as a procedure name. A procedure is a named set of instructions that can take in parameters and return values. It may be called "method" or "function" in different programming languages. Example:
    def multiply(x, y):
      product = x * y
      return product
    
    It is basically like a function to do this two the two parameters (which are independent variables to be filled with defined values) instead of constantly doing something like z = x * y and then printing Z. Using def is a lot more efficient and the python code below will show examples. Returning what you want see from it is also needed, so like, if I wanted to multiply x and y, I want to return, or see, the product.
  • Parameters: Parameters are independent variables used in the procedure to produce a result. It allows a procedure to execute without initially knowing specific input values.
  • Return Values: To use return values, you have to write the syntax return followed by the expression you would like to return var. A return statement exits a function and instructs python to continue executing the program and to return a certain value.

Everything Defined: Variables, Data Types, Assignment Operators Managing Complexity with Variables: Lists, 2D Lists, Dictionaries, Class Algorithms, Sequence, Selection, Iteration Expressions, Comparison Operators, Booleans Expressions and Selection, Booleans Expressions and Iteration, Truth Tables Characters, Strings, Length, Concatenation, Upper, Lower, Traversing Strings Python If, Elif, Else conditionals; Nested Selection Statements Python For, While loops with Range, with List Combining loops with conditionals to Break, Continue Procedural Abstraction, Python Def procedures, Parameters, Return Values

def multiply(x,y):
    product = x * y
    return product
a = 5
b = 10
c = 12
d = 15
x = 17
y = 2

multiply(x, y)
multiply(c,b)
multiply(a,y)
multiply(c,d)

### Instead of creating multiple variables that are the result of var1 and var2 and having to print it out, we can save some time by creating these functions.
180