You may exit out of this review and return later without penalty.
Close
Sharing assignments in OpenClass
OpenClass is on a mission to improve & democratize education. Through our platform, educators can share assignments privately or with our entire community to improve accessibility of the best learning resources around the world.
Our assignments guide students through research-backed study sessions to reinforce learning. If this review is relevant to your teachings, feel free to add it to one of your classes!
Our format is simple and engaging: students are asked a retrieval question, then shown corrective feedback and a multiple-choice mastery question to assess their understanding of the material. Assignments adapt to unique student needs and continue to draw questions until a student has demonstrated mastery.
Evaluate the boolean expressions shown in Figure A.
Provide values for `a`, `b`, and `c` that make the following statement evaluate as `True`:
`a + b == c and (c is a or c is b) and a != b`
What is wrong with the code in Figure A?
What's the output of the code in Figure A?
Write a function that returns `"a is greater than b"`, `"a is less than b"`, or `"a is equal to b"` depending on the values of two int input params `a` and `b`.
Write a function that converts an int `num` between 0-9 (inclusive) to its string equivalent (i.e., 1 -> "one").
Write an if statement that prints `a and b are equal` if two variables `a` and `b` have equal values, or `a and b are not equal` otherwise.
What do the boolean operators `and`, `or`, and `not` do in Python?
What is an if statement?
In Python, if/else statements are used to control the flow between two different options. How can we control the flow between more than two different options?
Fix the syntax error in the starting code.
Adjust the value of the variable `a` in the following code so that `a is below zero!` is printed.
What do the boolean operators `and`, `or`, and `not` do in Python?
(Student response here)
`and`: Returns `True` if both statements are true. Examples: `True and True` is `True`, `True and False` is `False`.
`or`: Returns `True` if at least one statement is true. Examples: `True or False` is `True`, `False or False` is `False`.
`not`: Returns the opposite of the result of the expression. Examples: `not True` is `False`, `not False` is `True`.
What is the result of the following expression: `not not True`