Previous Lecture Lecture 20

Lecture 20, Thu 03/14

Wrap up / review

Recorded Lecture: 3_14_24

''' Anouncements and Upcoming Deadlines

* zyBooks Week 10. Due Sunday 3/17 by 11:59PM PST
    * Any late work must be submitted to zyBooks no later
    than 11:59PM PST by 3/17

* Quiz 5 on Gradescope tomorrow Friday 3/15 (8am - 8pm)
    * Will focus on zyBooks Chapters 8 and 9
    * Once you start, you have 30 minutes to complete
    the quiz
    * You can submit answers within the 30 minutes (only
    the most recent submission will be graded)

* Course Evals. Please fill out the course eval by the end
of this week

* We will not have normal office / lab sections hours next
week
'''

''' Final Exam Logistics

* Wednesday of Finals Week 3/20 (12 - 2pm) on Gradescope
    * Window to take the final exam will ONLY be open
    from 12pm - 2pm PST (not a 12 hour window like quizzes)
    * You can resubmit answers within the two hours (only
    the most recent submission will be graded)
    * We will be monitoring Piazza so you may send a
    PRIVATE message asking CLARIFYING questions
        * If we feel the need to make a clarification
        to the entire class, we will make a public post

* Final exam will be cumulative
    * Will look similar to Quizzes in terms of types of
    questions asked (but the length of the final will be
    longer)
        * True / False
        * Short Answer
            * Briefly describe / define / state / write
            expressions
        * Multiple Choice / Select all correct answers
        * Write code satisfying a certain specification  

* Topics (Very High Level (Non Comprehensive) Review)

* Basic Input / Output
    * print(), input()
* Variables, Expressions, and Operators
    * Assignment, numerical expressions / operators
    * Note certain types may support operators and have
    its own unique functionality
        * number + number vs string + string vs list + list
    * Dynamic Typing (any type can be assigned to a variable)
    * Compount operators (+=, -=, ...)
* Basic Python Types
    * int, float, strings
    * type()
    * Conversion functions (int(), float(), str())
* f-strings and string formatting
    * Various formatting features
        * floating point precision
        * Expression evaluation {x=}
        * Escape characters (\n, \t, \", ...)
        * Raw strings
* Syntax vs. Runtime Errors
    * Syntax error: Structurally wrong with the code
    * Runtime error: When code is running (logical error)
* Modules
    * Importing / using Python modules and our own modules
    * if __name__ == '__main__' block (and its purpose)
    * using from vs import
* Creating Functions
    * Basic syntax / structure / indentation
    * Parameters and default parameters
    * return statements and None values
    * Returning multiple values (packing into a tuple /
    unpacking)
* Boolean
    * True / False
    * Relational operators (==, !=, <, <=, >, >=, ...)
    * Logical Operators (and, or, not)
* Conditions / Branching
    * Basic syntax structure / indentation / flow of
    execution of if, if-else, elif
* Assert statements
    * related to testing. Raises error if expression does
    not equal to True
* Containers
    * len()
    * Python syntax dealing with each container type
    * Lists, Dictionaries, Sets, Strings, Tuples,
    Namedtuples
    * in operator
    * Mutable vs. Immutable
        * Mutable: Lists, Dictionaries, Sets
        * Immutable: Tuples, namedtuples, strings
        * Behavior of mutable vs immutable types when passed
        as a parameter into a function
* Functions vs Methods
    * Methods are like functions, but usually used with
    an instance object
    * Methods may return values or None
* Methods / functionality for containers
    * Lists: list(), slicing [i:j:z], append, insert, extend,
    remove, pop, sort, etc.
    * Sets: set(), add, remove, pop, etc.
    * Dictionaries: dict(), clear, pop, update, get, etc.
    * Strings: replace, find, rfind, count, strip, etc.
    * ...
* Binary Number Representation
    * Convert binary to base 10
    * Convert base 10 to binary
* Representing Text Numerically
    * ASCII values
* Functions as Objects
    * Allows us to assign function identifiers to variables
    and call the function in various places in code
* Scope / Lifetime of a variable
    * Local variables
    * Gloval variables
* Loops
    * While, for
    * break and continue
        * Loop else (used to execute code ONLY if loop
        termintes naturally)
    * range() function
    * Accumulator Pattern
    * enumerate() (able to get index AND element while looping)
* List Nesting
    * Lists within Lists
* Dictionary Nesting
    * Dictionaries within Dictionaries
* Dictionary Views
    * Useful for read-only access to dictionary state
        * items(), keys(), values()
* Lexicographical Order
    * Uses ASCII values to determine comparison
    * lower(), upper() to support lexicographical ordering
* Recursion
    * Properties of recursion
    * Patterns of recursion (accumulate, search (Binary Search))
    * Define / implement recursive solutions
* Files IO
    * Open / close file for read / write / append
    * read(), readline(), readlines(), for loop
    * write()
    * with statement (automatically closes file)
    * CSV Reader (used to extract rows of data in a csv file)
'''