.. _session_1_03: ###################################################### Session 3: Booleans, Sequences, Iteration, and Strings ###################################################### **Booleans, Sequences, Iteration, and Strings** Pre-class prep ============== Read: :ref:`booleans` Read: :ref:`sequences` Read: :ref:`iteration` Read: :ref:`strings` Supplemental Reading: --------------------- Think Python, chapters 7 -- 10 (11, 12) (http://greenteapress.com/thinkpython/html/thinkpython008.html) Dive Into Python: chapters 3, 4 (http://www.diveintopython3.net/strings.html) In-class Activities =================== Working with Booleans, Conditional Expressions, etc --------------------------------------------------- Re-write a couple CodingBat exercises, returning the direct boolean results, and/or using ternary expressions. Variable Scope -------------- Experiment with ``locals`` by adding this statement one of the functions we wrote last week (or any other function you wrote): .. code-block:: python print(locals()) Sequences Exercises ------------------- :ref:`exercise_slicing` :ref:`exercise_list_lab` String Exercises ---------------- :ref:`exercise_string_formatting` (optional) :ref:`exercise_rot13` Mailroom Exercises ------------------ You've now got the basics of the language down -- enough to write the first full "program": :ref:`exercise_mailroom_part1` Post-class Activites ==================== Finish the mailroom project. And the other exercises Look at the next session for reading, etc: :ref:`session_1_04`