**CS 1109: Fundamental Programming Concepts (Summer 2023)** [Home](../index.md.html) • [Schedule](../schedule.md.html) • [Syllabus](../syllabus.md.html) • [Assignments](../assignments.md.html) • [Labs](../labs.md.html) (#) Exam Study Guide Use this study guide to help you prepare for the exam on July 21st, 2023. (##) Practice Exam One of the best ways to prepare for an exam is to practice answering questions. You can find the practice exam either by going to the [Schedule page](../schedule.md.html) or by downloading it here: Click here to download `practice_exam.pdf`. Once you have tried the practice exam on your own, you can consult the instructor's solutions here: Click here to download `practice_exam-solutions.pdf`. If you have questions about whether your individual solutions are correct or about my solutions, either come to office hours or ask a question on [Ed](https://edstem.org/us/courses/40504/discussion/). (##) "Students should be able to..." Below are a list of "Students should be able to..." statements that serve as a rough checklist for what to study in preparation for the exam. Each set of statements are categorized by topic. !!! WARNING There will only be questions on the exam concerning the below topics. However, **not** all topics listed below will appear on the exam. *If a topic is not listed below (e.g., writing representative test cases), then you will **not** be asked questions about that topic.* (###) Types & Expressions 1. Students should know the definition of a type. [[Lab 1](../labs/lab1.md.html)] 2. Students should be familiar with Python's built-in types (e.g., `int`, `float`, `str`, `list`, `bool`). [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] 3. Students should know that strings are **immutable** and that lists are **mutable**. [[Lecture: Strings, Sequences, and Lists](../lectures/2023-07-05.pdf)] 4. Students should know how to convert between types. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] 5. Students should be able to write the results of operations on the built-in types and evaluate expressions according to the precedence of Python operations by hand. [[Lab 1](../labs/lab1.md.html)] 6. Students should be able to identify type errors in written code. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] (###) Variables & Assignments 1. Students should be able to describe how to execute an assignment statement. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] 2. Students should know the difference between `=` and `==`. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] 3. Students should be able to identify the type of a variable. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] 4. Students should be able to differentiate between **local** and **global** variables and give examples of both. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html), [Lab 7: Memory](../lectures/2023-07-14-memory.pdf)] (###) Conditionals & Control Flow 1. Students should be able to correctly evaluate basic Boolean expressions. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html)] 2. Students should be able to translate English conditions into Boolean expressions. [[Lecture: Variables, Assignments, & Conditionals](../lectures/2023-06-26.html), [Lecture: More Conditionals](../lectures/2023-06-27.pdf)] 3. Students should be able to **identify** and **produce** correct `if`, `if-elif-else`, and `if-else` statements on paper. [[Lecture: More Conditionals](../lectures/2023-06-27.pdf)] 4. Students should be able to trace program execution involving conditionals by providing the correct values for variables and `print()` statements, as well as constructing diagrams correctly. [[Lab 7: Memory](../lectures/2023-07-14-memory.pdf)] 5. Students should be able to differentiate between **chained conditionals** and **nested conditionals** and determine which is more appropriate to use. [[Lecture: More Conditionals](../lectures/2023-06-27.pdf)] (###) Functions [[Lecture: Functions & Modules](../lectures/2023-06-28.pdf)] 1. Students should know the definition of a function. 2. Students should be able to provide examples of built-in functions in Python. 3. Students should be able to call functions with arguments in Python. 4. Students should be able to differentiate between **function headers** and **function bodies**. 5. Students should be able to correctly construct function headers given a function name and the set of parameters. 6. Students should know the difference between and be able to identify **void functions** and **fruitful functions**. 7. Students should be able to describe the difference between `print` and `return` and when it is appropriate to use each. 8. Students should be able to implement basic functions using proper syntax based on a given specification. 9. Students should be able to define and give examples of local variables. [[Lab 7: Memory](../lectures/2023-07-14-memory.pdf)] 10. Students should know the difference between a **function definition** and a **function call**. (###) Modules [[Lecture: Functions & Modules](../lectures/2023-06-28.pdf)] 1. Students should know the difference between a **module** and a **script**. 2. Students should be able to access module variables and functions appropriately based on import using **dot notation**. 3. Students should be able to describe the danger of importing everything from a module (i.e., `from module_name import *`). (###) Strings & String Indexing/Slicing [[Lecture: Strings, Sequences, and Lists](../lectures/2023-07-05.pdf)] 1. Students should be able to use string operations correctly. 2. Students should be able to access individual characters in a string using indexing. 3. Students should be able to correctly use the `len()` functions on strings. 4. Students should be able to access sub-strings using the correct slicing syntax. 5. Students should be able to evaluate string slices. 6. Students should be able to write basic functions that manipulate strings. (###) Lists [[Lecture: Strings, Sequences, and Lists](../lectures/2023-07-05.pdf)] 1. Students should be able to describe the similarities and differences between strings and lists. 2. Students should be able to access individual elements of a list using indexing. 3. Students should be able to correctly use the `len()` function on lists. 4. Students should be able to access sub-lists of a list using the correct slicing syntax. 5. Students should be able to identify the type of elements in a list. (###) Iteration [[Lecture: Definite Iteration](../lectures/2023-07-06.pdf), [Lecture: Indefinite Iteration](../lectures/2023-07-10.pdf)] 1. Students should be able to describe what iteration does. 2. Students should be able to describe the difference between **definite iteration** and **indefinite iteration**. 3. Students should be able to determine whether it is more appropriate to use a `for`-loop or a `while`-loop, justify their reasoning, and provide examples for each. 4. Students should be able to write the sequences that `range(a)`, `range(a,b)`, and `range(a,b,s)` produce given values for `a`, `b`, and `s`. 5. Students should be able to write basic `for`-loops which repeats something `n` times (e.g., print `'Hi!'` 10 times) using correct syntax. 6. Students should be able to write basic `for`-loops which iterate *over* a list or a string using correct syntax. 7. Students should be able to identify when and know how to use the **accumulator pattern** for writing loops. 8. Students should be able to describe the difference between a **stopping condition** and a **continuation condition**. Additionally, students should know how to turn a stopping condition into a continuation condition and vice-versa. 9. Students should be able to write basic `while`-loops which repeat something until some condition is met. 10. Students should be able to correctly trace the execution of basic **nested** loops. (###) Memory [[Lab 7: Memory](../lectures/2023-07-14-memory.pdf)] 1. Students should be able to identify the global and local variables in a Python script. 2. Students should be able to describe the difference between the **global space** and **call frames**. 3. Students should be able to draw memory diagrams involving multiple function calls, including function calls that occur within function bodies. 4. Students should be able to determine whether a variable is referring to a local variable or a global variable given context. 5. Students should know that global variables can only be **read** inside functions and that local variables are **undefined** outside of the function they are defined in. 6. Students should know that global variables can only be modified in the **global space**. ------------------------------------------------------------------------------- Copyright © [Zachary J. Susag](https://zacharysusag.net) ![ ](../assets/img/cc-by-sa.png) Unless specified elsewhere on this page, this work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).