::: {#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}
    -   [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"}
::: {#glossary .section}
[2.16. ]{.section-number}Glossary[¶](#glossary "Permalink to this heading"){.headerlink}
========================================================================================

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

:   A statement that assigns a value to a name (variable). To the left
    of the assignment operator, `=`{.docutils .literal .notranslate}, is
    a name. To the right of the assignment token is an expression which
    is evaluated by the Python interpreter and then assigned to the
    name. The difference between the left and right hand sides of the
    assignment statement is often confusing to new programmers. In the
    following assignment:

    ::: {.highlight-python .notranslate}
    ::: {.highlight}
        n = n + 1
    :::
    :::

    `n`{.docutils .literal .notranslate} plays a very different role on
    each side of the `=`{.docutils .literal .notranslate}. On the right
    it is a *value* and makes up part of the *expression* which will be
    evaluated by the Python interpreter before assigning it to the name
    on the left.

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

:   `=`{.docutils .literal .notranslate} is Python's assignment token,
    which should not be confused with the mathematical comparison
    operator using the same symbol.

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

:   An expression that is either true or false.

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

:   There are exactly two boolean values: `True`{.docutils .literal
    .notranslate} and `False`{.docutils .literal .notranslate}. Boolean
    values result when a boolean expression is evaluated by the Python
    interepreter. They have type `bool`{.docutils .literal
    .notranslate}.

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

:   see **data type** below

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

:   Information in a program that is meant for other programmers (or
    anyone reading the source code) and has no effect on the execution
    of the program.

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

:   A set of values. The type of a value determines how it can be used
    in expressions. So far, the types you have seen are integers
    (`int`{.docutils .literal .notranslate}), floating-point numbers
    (`float`{.docutils .literal .notranslate}), and strings
    (`str`{.docutils .literal .notranslate}).

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

:   Decrease by 1.

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

:   To simplify an expression by performing the operations in order to
    yield a single value.

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

:   A combination of operators and operands (variables and values) that
    represents a single result value. Expressions are evaluated to give
    that result.

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

:   A Python data type which stores *floating-point* numbers.
    Floating-point numbers are stored internally in two parts: a *base*
    and an *exponent*. When printed in the standard format, they look
    like decimal numbers. Beware of rounding errors when you use
    `float`{.docutils .literal .notranslate}s, and remember that they
    are only approximate values.

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

:   Both as a noun and as a verb, increment means to increase by 1.

initialization (of a variable)[¶](#term-initialization-of-a-variable "Permalink to this term"){.headerlink}

:   To initialize a variable is to give it an initial value. Since in
    Python variables don't exist until they are assigned values, they
    are initialized when they are created. In other programming
    languages this is not the case, and variables can be created without
    being initialized, in which case they have either default or
    *garbage* values.

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

:   A Python data type that holds positive and negative **whole**
    numbers.

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

:   An operation that divides one integer by another and yields an
    integer. Integer division yields only the whole number of times that
    the numerator is divisible by the denominator and discards any
    remainder.

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

:   A reserved word that is used by the compiler to parse program; you
    cannot use keywords like `if`{.docutils .literal .notranslate},
    `def`{.docutils .literal .notranslate}, and `while`{.docutils
    .literal .notranslate} as variable names.

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

:   A number or string that is written directly in a program. Sometimes
    these are also referred to as literal values, or just values, but be
    careful not to confuse a literal value as written in a program with
    an internal value maintained by the Python interpreter during
    execution of a program.

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

:   One of the operators that combines boolean expressions:
    `and`{.docutils .literal .notranslate}, `or`{.docutils .literal
    .notranslate}, and `not`{.docutils .literal .notranslate}.

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

:   An operator, denoted with a percent sign ( `%`{.docutils .literal
    .notranslate}), that works on integers and yields the remainder when
    one number is divided by another.

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

:   Also known as a data object (or data value). The fundamental things
    that programs are designed to manipulate (or that programmers ask to
    do things for them).

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

:   One of the values on which an operator operates.

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

:   A special symbol that represents a simple computation like addition,
    multiplication, or string concatenation.

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

:   Used during interactive input to provide the use with hints as to
    what type of value to enter.

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

:   A picture showing a variable with an arrow pointing to the value
    (object) that the variable refers to. See also **state snapshot**.

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

:   The set of rules governing the order in which expressions involving
    multiple operators and operands are evaluated.

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

:   A graphical representation of a set of variables and the values to
    which they refer, taken at a particular instant during the program's
    execution.

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

:   An instruction that the Python interpreter can execute. So far we
    have only seen the assignment statement, but we will soon meet the
    `import`{.docutils .literal .notranslate} statement and the
    `for`{.docutils .literal .notranslate} statement.

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

:   A Python data type that holds a string of characters.

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

:   A function that can convert a data value from one type to another.

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

:   A number or string (or other things to be named later) that can be
    stored in a variable or computed in an expression.

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

:   A name that refers to a value.

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

:   A name given to a variable. Variable names in Python consist of a
    sequence of letters (a..z, A..Z, or \_) and digits (0..9) that
    begins with a letter. In best programming practice, variable names
    should be chosen so that they describe their use in the program,
    making the program *self documenting*.
:::

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

-   [[](Input.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.
:::
