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

```{=html}
<!-- -->
```
-   
-   [This Chapter](../index.html){.dropdown-toggle}
    -   [23.1 Introduction: Map, Filter, List Comprehensions, and
        Zip](intro.html){.reference .internal}
    -   [23.2 Map](map.html){.reference .internal}
    -   [23.3 Filter](filter.html){.reference .internal}
    -   [23.4 List Comprehensions](listcomp.html){.reference .internal}
    -   [23.5 Zip](zip.html){.reference .internal}
    -   [23.6 Exercises](Exercises.html){.reference .internal}
    -   [23.7 Chapter Assessment](ChapterAssessment.html){.reference
        .internal}
-   
-   
:::
:::
:::

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

::: {#main-content .container role="main"}
::: {#adcopy_1 .adcopy style="display: none;"}
#### Before you keep reading\...

Runestone Academy can only continue if we get support from individuals
like you. As a student you are well aware of the high cost of textbooks.
Our mission is to provide great books to you for free, but we ask that
you consider a \$10 donation, more if you can or less if \$10 is a
burden.

::: {.donateb}
[Support Runestone Academy Today](/runestone/default/donate?ad=1){.btn
.btn-info}
:::

::: {#adcopy_2 .adcopy style="display: none;"}
#### Before you keep reading\...

Making great stuff takes time and \$\$. If you appreciate the book you
are reading now and want to keep quality materials free for other
students please consider a donation to Runestone Academy. We ask that
you consider a \$10 donation, but if you can give more thats great, if
\$10 is too much for your budget we would be happy with whatever you can
afford as a show of support.

::: {.donateb}
[Support Runestone Academy Today](/runestone/default/donate?ad=2){.btn
.btn-info}
:::
:::
:::

::: {#chapter-assessment .section}
[23.7. ]{.section-number}Chapter Assessment[¶](#chapter-assessment "Permalink to this heading"){.headerlink}
============================================================================================================

::: {.runestone .explainer .ac_section}
::: {#ac21_7_1 component="activecode" question_label="23.7.1"}
::: {#ac21_7_1_question .ac_question}
Write code to assign to the variable `map_testing`{.docutils .literal
.notranslate} all the elements in lst\_check while adding the string
"Fruit: " to the beginning of each element using mapping.
:::
:::
:::

::: {.runestone .explainer .ac_section}
::: {#ac21_7_2 component="activecode" question_label="23.7.2"}
::: {#ac21_7_2_question .ac_question}
Below, we have provided a list of strings called `countries`{.docutils
.literal .notranslate}. Use filter to produce a list called
`b_countries`{.docutils .literal .notranslate} that only contains the
strings from `countries`{.docutils .literal .notranslate} that begin
with B.
:::
:::
:::

::: {.runestone .explainer .ac_section}
::: {#ac21_7_3 component="activecode" question_label="23.7.3"}
::: {#ac21_7_3_question .ac_question}
Below, we have provided a list of tuples that contain the names of Game
of Thrones characters. Using list comprehension, create a list of
strings called `first_names`{.docutils .literal .notranslate} that
contains only the first names of everyone in the original list.
:::
:::
:::

::: {.runestone .explainer .ac_section}
::: {#ac21_7_4 component="activecode" question_label="23.7.4"}
::: {#ac21_7_4_question .ac_question}
Use list comprehension to create a list called `lst2`{.docutils .literal
.notranslate} that doubles each element in the list, `lst`{.docutils
.literal .notranslate}.
:::
:::
:::

::: {.runestone .explainer .ac_section}
::: {#ac21_7_5 component="activecode" question_label="23.7.5"}
::: {#ac21_7_5_question .ac_question}
Below, we have provided a list of tuples that contain students' names
and their final grades in PYTHON 101. Using list comprehension, create a
new list `passed`{.docutils .literal .notranslate} that contains the
names of students who passed the class (had a final grade of 70 or
greater).
:::
:::
:::

::: {.runestone .explainer .ac_section}
::: {#ac21_7_6 component="activecode" question_label="23.7.6"}
::: {#ac21_7_6_question .ac_question}
Write code using zip and filter so that these lists (l1 and l2) are
combined into one big list and assigned to the variable
`opposites`{.docutils .literal .notranslate} if they are both longer
than 3 characters each.
:::
:::
:::

::: {.runestone .explainer .ac_section}
::: {#ac21_7_7 component="activecode" question_label="23.7.7"}
::: {#ac21_7_7_question .ac_question}
Below, we have provided a `species`{.docutils .literal .notranslate}
list and a `population`{.docutils .literal .notranslate} list. Use zip
to combine these lists into one list of tuples called
`pop_info`{.docutils .literal .notranslate}. From this list, create a
new list called `endangered`{.docutils .literal .notranslate} that
contains the names of species whose populations are below 2500.
:::
:::
:::
:::

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

-   [[](Exercises.html)]{#relations-prev}
-   [[](../Projects/toctree.html)]{#relations-next}
:::

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

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