::: {#navbar .navbar .navbar-default .navbar-fixed-top role="navigation"}
::: {.container}
::: {.navbar-header}
[]{.icon-bar} []{.icon-bar} []{.icon-bar}

<div>

[![](../_static/img/RAIcon.png)](/runestone/default/user/login){.brand-logo}
[fopp](../index.html){#rs-book-toc-link .navbar-brand}

</div>
:::

::: {.navbar-collapse .collapse .navbar-ex1-collapse}
-   
-   []{#ad_warning}
-   []{#browsing_warning}
-   
-   [*[Search]{.visuallyhidden
    aria-label="Search"}*](#){.dropdown-toggle}
    -   [Table of Contents](../index.html)

    -   [Book Index](../genindex.html)

    -   

    -   ::: {.input-group}
        :::
-   
-   [*[User]{.visuallyhidden aria-label="User"}*](#){.dropdown-toggle}
    -   []{.loggedinuser}

    -   

    -   [Course Home](/ns/course/index)

    -   [Assignments](/assignment/student/chooseAssignment)

    -   [Practice](/runestone/assignments/practice)

    -   [[Peer Instruction
        (Instructor)](/runestone/peer/instructor.html)]{#inst_peer_link}

    -   [Peer Instruction (Student)](/runestone/peer/student.html)

    -   

    -   [Change Course](/runestone/default/courses)

    -   

    -   [[Instructor\'s
        Page](/runestone/admin/index)]{#ip_dropdown_link}

    -   [Progress Page](/runestone/dashboard/studentreport)

    -   

    -   [Edit Profile](/runestone/default/user/profile){#profilelink}

    -   [Change
        Password](/runestone/default/user/change_password){#passwordlink}

    -   [Register](/runestone/default/user/register){#registerlink}

    -   [Login](#)

    -   ::: {.slider .round}
        :::

        Dark Mode
-   
-   [[*[Scratch Activecode]{.visuallyhidden
    aria-label="Scratch Activecode"}*](javascript:runestoneComponents.popupScratchAC())]{#scratch_ac_link}
-   
-   [*[Help]{.visuallyhidden aria-label="Help"}*](#){.dropdown-toggle}
    -   [FAQ](http://runestoneinteractive.org/pages/faq.html)
    -   [Instructors Guide](https://guide.runestone.academy)
    -   
    -   [About Runestone](http://runestoneinteractive.org)
    -   [Report A
        Problem](/runestone/default/reportabug?course=fopp&page=Glossary)
-   

```{=html}
<!-- -->
```
-   
-   [This Chapter](../index.html){.dropdown-toggle}
    -   [8.1 Intro: What we can do with Turtles and
        Conditionals](intro-TurtlesandConditionals.html){.reference
        .internal}
    -   [8.2 Boolean Values and Boolean
        Expressions](BooleanValuesandBooleanExpressions.html){.reference
        .internal}
    -   [8.3 Logical operators](Logicaloperators.html){.reference
        .internal}
    -   [8.4 The in and not in
        operators](Theinandnotinoperators.html){.reference .internal}
    -   [8.5 Precedence of
        Operators](PrecedenceofOperators.html){.reference .internal}
    -   [8.6 Conditional Execution: Binary
        Selection](ConditionalExecutionBinarySelection.html){.reference
        .internal}
    -   [8.7 Omitting the else Clause: Unary
        Selection](OmittingtheelseClauseUnarySelection.html){.reference
        .internal}
    -   [8.8 Nested conditionals](Nestedconditionals.html){.reference
        .internal}
    -   [8.9 Chained conditionals](Chainedconditionals.html){.reference
        .internal}
    -   [8.10 The Accumulator Pattern with
        Conditionals](TheAccumulatorPatternwithConditionals.html){.reference
        .internal}
    -   [8.11 👩‍💻 Setting Up
        Conditionals](WPSettingUpConditionals.html){.reference
        .internal}
    -   [8.12 Glossary](Glossary.html){.reference .internal}
    -   [8.13 Exercises](Exercises.html){.reference .internal}
    -   [8.14 Chapter Assessment](week3a1.html){.reference .internal}
-   
-   
:::
:::
:::

::: {#continue-reading .container}
:::

::: {#main-content .container role="main"}
::: {#glossary .section}
[8.12. ]{.section-number}Glossary[¶](#glossary "Permalink to this heading"){.headerlink}
========================================================================================

block[¶](#term-block "Permalink to this term"){.headerlink}

:   A group of consecutive statements with the same indentation.

body[¶](#term-body "Permalink to this term"){.headerlink}

:   The block of statements in a compound statement that follows the
    header.

boolean values[¶](#term-boolean-values "Permalink to this term"){.headerlink}

:   A value that is either True or False. True and False must be
    capitalized to be considered Boolean.

branch[¶](#term-branch "Permalink to this term"){.headerlink}

:   One of the possible paths of the flow of execution determined by
    conditional execution.

chained conditional[¶](#term-chained-conditional "Permalink to this term"){.headerlink}

:   A conditional branch with more than two possible flows of execution.
    In Python chained conditionals are written with
    `if ... elif ... else`{.docutils .literal .notranslate} statements.

comparison operator[¶](#term-comparison-operator "Permalink to this term"){.headerlink}

:   One of the operators that compares two values: `==`{.docutils
    .literal .notranslate}, `!=`{.docutils .literal .notranslate},
    `>`{.docutils .literal .notranslate}, `<`{.docutils .literal
    .notranslate}, `>=`{.docutils .literal .notranslate}, and
    `<=`{.docutils .literal .notranslate}.

condition[¶](#term-condition "Permalink to this term"){.headerlink}

:   The boolean expression in a conditional statement that determines
    which branch is executed.

conditional statement[¶](#term-conditional-statement "Permalink to this term"){.headerlink}

:   A statement that controls the flow of execution depending on some
    condition. In Python the keywords `if`{.docutils .literal
    .notranslate}, `elif`{.docutils .literal .notranslate}, and
    `else`{.docutils .literal .notranslate} are used for conditional
    statements.

logical operators[¶](#term-logical-operators "Permalink to this term"){.headerlink}

:   "and", "or" and "not" are logical operators used to evaluate
    expressions. Their semantic meaning is similar to their English
    meaning.

nesting[¶](#term-nesting "Permalink to this term"){.headerlink}

:   One program structure within another, such as a conditional
    statement inside a branch of another conditional statement.

unary selection[¶](#term-unary-selection "Permalink to this term"){.headerlink}

:   A selection statement in which there is only an "if" statement and
    the "else" statement is omitted entirely. In an unary selection, the
    statements are only executed if the condition evaluates to true,
    otherwise the program continues to the body following the if
    statement.
:::

::: {style="width: 100%"}
::: {ea-publisher="runestoneacademy" ea-type="image" style="display: flex; justify-content: center"}
:::
:::

::: {#scprogresscontainer}
You have attempted []{#scprogresstotal} of []{#scprogressposs}
activities on this page

::: {#subchapterprogress aria-label="Page progress"}
:::
:::

-   [[](WPSettingUpConditionals.html)]{#relations-prev}
-   [[](Exercises.html)]{#relations-next}
:::

::: {.container}
[]{#numuserspan}[]{.loggedinuser} \| [Back to top](#)

© Copyright 2017 bradleymiller. Created using
[Runestone](http://runestoneinteractive.org/) 7.2.10.
:::
