In-Class Activity: Runestone Activities with Boolean Values and Expressions

 


Introduction

In this activity you will learn about Boolean values and expressions in Python.



Exercises

In this set of exercises, we explore and experiment with Boolean values and expressions in Python. You will write your answers to the specified exercises in a word document or by hand on a piece of paper that you will scan or take a photo of to submit.

  1. Read Section 8.2: Boolean Values and Boolean Expressions.

  2. Write down your answer(s) to Activity: 8.2.5 Multiple Choice

  3. Read Section 8.3: Logical Operators. Stop at Section 8.3.1. You may skip that subsection for now.

  4. For ActiveCode Activities 8.3.1 and 8.3.2, write down what you predict the output to be. Then run the code. Describe what you see compared to what you predicted.

  5. Read Section 8.4: The 'in' and 'not in' operators.

  6. Write down your output for Activity: 8.4.1 ActiveCode.

  7. Write down your output for Activity: 8.4.2 ActiveCode.

  8. Read Section 8.5: Precedence of Operators.

  9. Write down your answer for Activity: 8.5.2 MultipleChoice

  10. Write down your answer for Exercise 3 in Section 8.13. (Note: It says Activity: 8.13.4 ActiveCode at the bottom.)

  11. Write down your answer to Exercise 4 in Section 8.13. (Note: It says Activity: 8.13.5 ActiveCode at the bottom.)

Submit