Quiz 3: Predicates, Conditionals, and While Loops
Learning Goals
Booleans and Predicates
- Use relational and logical operators (<, >, ==, !=, and, or, not, etc.) to write expressions
- Define the behavior of logical operations including and, or, and not
- Write small predicates using logical and relational operators
- Predict the values produced by expressions that use a single relational and logical operators
- Understand and define predicates (functions that return booleans)
Conditionals
- Predict/trace the operation of nested and chained conditionals
- Reason about and predict the execution flow of code in the presence of conditional, assignment, and return statements
- Model the execution of code without running it on a computer
- Translate the behavior of code into its semantic meaning, and compare the semantics of multiple code snippets
- Write complex conditionals
- Solve problems using conditional statements
- Translate English problem descriptions into code
While Loops
- Use while loops to translate English descriptions of iteration into Python
- Explain the rules governing a while loop's execution in English
- Use indexing to access elements in a string from the front to back
- Use print statements to illustrate the operation of a loop
- Predict the effects of while loops
Study Guide
Blank (fill in your solutions)
Solutions
After your quiz is graded by instructors, you will get an email from Gradescope. Solutions for individual quiz questions are provided in the Gradescope rubric.