::: {#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=toctree)
-   

```{=html}
<!-- -->
```
-   
-   [This Chapter](../index.html){.dropdown-toggle}
    -   [2.1
        Introduction](intro-VariablesExpressionsandStatements.html){.reference
        .internal}
    -   [2.2 Values and Data Types](Values.html){.reference .internal}
    -   [2.3 Operators and Operands](Operators.html){.reference
        .internal}
    -   [2.4 Function Calls](FunctionCalls.html){.reference .internal}
    -   [2.5 Data Types](DataTypes.html){.reference .internal}
    -   [2.6 Type conversion
        functions](ConvertTypeFunctions.html){.reference .internal}
    -   [2.7 Variables](Variables.html){.reference .internal}
    -   [2.8 Variable Names and
        Keywords](VariableNamesandKeywords.html){.reference .internal}
    -   [2.9 👩‍💻 Choosing the Right Variable
        Name](WPChoosingtheRightVariableName.html){.reference .internal}
    -   [2.10 Statements and
        Expressions](StatementsandExpressions.html){.reference
        .internal}
    -   [2.11 Order of Operations](OrderofOperations.html){.reference
        .internal}
    -   [2.12 Reassignment](Reassignment.html){.reference .internal}
    -   [2.13 Updating Variables](UpdatingVariables.html){.reference
        .internal}
    -   [2.14 👩‍💻 Hard-Coding](HardCoding.html){.reference .internal}
    -   [2.15 Input](Input.html){.reference .internal}
    -   [2.16 Glossary](Glossary.html){.reference .internal}
    -   [2.17 Exercises](Exercises.html){.reference .internal}
    -   [2.18 Chapter Assessment](week1a2.html){.reference .internal}
-   
-   
:::
:::
:::

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

::: {#main-content .container role="main"}
::: {#variables-statements-and-expressions .section}
[2. ]{.section-number}Variables, Statements, and Expressions[¶](#variables-statements-and-expressions "Permalink to this heading"){.headerlink}
===============================================================================================================================================

::: {.toctree-wrapper .compound}
[Variables, Statements, and Expressions]{.caption-text}

-   [2.1.
    Introduction](intro-VariablesExpressionsandStatements.html){.reference
    .internal}
    -   [2.1.1. Learning
        Goals](intro-VariablesExpressionsandStatements.html#learning-goals){.reference
        .internal}
    -   [2.1.2.
        Objectives](intro-VariablesExpressionsandStatements.html#objectives){.reference
        .internal}
-   [2.2. Values and Data Types](Values.html){.reference .internal}
-   [2.3. Operators and Operands](Operators.html){.reference .internal}
-   [2.4. Function Calls](FunctionCalls.html){.reference .internal}
    -   [2.4.1. Function calls as part of complex
        expressions](FunctionCalls.html#function-calls-as-part-of-complex-expressions){.reference
        .internal}
    -   [2.4.2. Functions are objects; parentheses invoke
        functions](FunctionCalls.html#functions-are-objects-parentheses-invoke-functions){.reference
        .internal}
-   [2.5. Data Types](DataTypes.html){.reference .internal}
-   [2.6. Type conversion
    functions](ConvertTypeFunctions.html){.reference .internal}
-   [2.7. Variables](Variables.html){.reference .internal}
-   [2.8. Variable Names and
    Keywords](VariableNamesandKeywords.html){.reference .internal}
-   [2.9. 👩‍💻 Choosing the Right Variable
    Name](WPChoosingtheRightVariableName.html){.reference .internal}
-   [2.10. Statements and
    Expressions](StatementsandExpressions.html){.reference .internal}
-   [2.11. Order of Operations](OrderofOperations.html){.reference
    .internal}
-   [2.12. Reassignment](Reassignment.html){.reference .internal}
    -   [2.12.1. Developing your mental model of How Python
        Evaluates](Reassignment.html#developing-your-mental-model-of-how-python-evaluates){.reference
        .internal}
-   [2.13. Updating Variables](UpdatingVariables.html){.reference
    .internal}
-   [2.14. 👩‍💻 Hard-Coding](HardCoding.html){.reference .internal}
-   [2.15. Input](Input.html){.reference .internal}
-   [2.16. Glossary](Glossary.html){.reference .internal}
-   [2.17. Exercises](Exercises.html){.reference .internal}
    -   [2.17.1. Contributed
        Exercises](Exercises.html#contributed-exercises){.reference
        .internal}
-   [2.18. Chapter Assessment](week1a2.html){.reference .internal}
:::
:::

::: {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"}
:::
:::

-   [[](../GeneralIntro/Exercises.html)]{#relations-prev}
-   [[](intro-VariablesExpressionsandStatements.html)]{#relations-next}
:::

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

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