Study Topics for Midterm Exam
- Syllabus
- goals
- late policy
- plagiarism policy
- Introduction
- model of a machine - CPU, RAM, storage
- properties of RAM, secondary storage
- units - KB, MB, GB, TB, etc.
- Guido van Rossum's contribution
- programming languages
- machine language
- high level language
- designing problem solutions
- pseudocode
- algorithm - a set of steps for solving a problem
- testing - test cases, plans - regression testing
- IDE and its components
- compiler vs. interpreter
- syntax and semantics (logic)
- Documentation - comments, prolog: purpose, pre- and post-conditions
- Kinds of errors
- Variables and Expressions
- variables
- properties and which ones can change
- languages that are dynamically typed "weakly" versus staticly typed "strongly"
- assignment statement
- how it operates, precisely (right side, left side, ...)
- Also how the augmented assignment operators work (+=, -=, *=, /=, etc.)
- reserved words - keywords
- identifiers
- syntax rules - how to make identifiers
- case sensitive
- arithmetic operators
- precedence of operators
- division operator- floor (//) versus floating point (/)
- remainder mod "%"
- ** exponentiation - right associative
- mixed type expressions
- the type each operator returns
- input - what is its argument (prompt), what type does it return, what happens when it is executed
- structure of a Python program
- main function header - "def main ():"
- printing to space horizontally and vertically on the shell window
- how do end= and sep= work?
- How does the .format method work?
- Data Types
- how to tell the difference
- what do the constants of each type look like?
- kinds
- string, double quotes vs. single quotes vs. triple quotes
- escaped characters
- integer
- float - exponential (scientific) notation, mantissa+exponent
- type casting
- Pre-written functions
- import statements - 3 forms of it
- math library
- how to call them
- Structured Programming
- control structure versus data structure
- four kinds of control structures
- general guarantee for all control structures (One entrance, One exit)
- sequence
- what is it?
- guarantees - executed in order, started at first step, ended at last step
- selection
- what is it?
- guarantees
- entrance at condition,
- one branch or the other executed,
- never both branches at the same time
- after exit of either branch, continues at same point
- dead code - don't do it! logically impossible to execute
- iteration
- what is it?
- guarantees - entrance at condition, exit only from condition at top
- infinite loop - don't do it!
- module (function)
- what is it?
- guarantees - entrance at top of definition, exit at bottom, returns to point it was called from
- can have dead code too! NO code after return statement!
- Loops
- for loops
- an accumulator statement - how it works
- the range function
- three forms with 1, 2, or 3 arguments
- Operators and builtin functions
- Whenever you see a new operator or a new function, ask yourself these questions
- what is its semantics? or what does it DO? what do its arguments mean?
- how many operands or arguments does it have? what type?
- what type (or types) does it return? or does it return None?
- Branching (Conditionals)
- bool constants - True, False
- relational operators <, >, etc.
- logical operators - and, or, not
- precedence with all other operators
- truth tables - how do the operators work?
- DeMorgan's laws
- contradictions and tautologies
- if statements
- nested if statements
- which if does the else go with?
- if - elif statements
- abbreviated if statements - ones that look like "if gold:"
- open and closed selections
- tracing ifs
- comparing floats
- comparing strings - ASCII ordering
- What does ASCII stand for?
- testing if's