9.19. Group Work: Lists

It is best to use a POGIL approach with the following. In POGIL students work in groups on activities and each member has an assigned role. For more information see https://cspogil.org/Home.

Note

If you work in a group, have only one member of the group fill in the answers on this page. You will be able to share your answers with the group at the bottom of the page.

Many interesting problems involve manipulating sequences of data. This activity should help you learn about two types of sequences in Python: lists and strings. Both lists and strings hold items in order and you can use an index to get the value at a location. The index of the first item in each is 0.

Learning Objectives

After completing this activity, Students should be able to:

Process Skill Goals

During the activity, students should make progress toward:

Edit the code below to answer the following questions.

Construct a function that replaces a value in a list with a new specified value and returns the list with the new value.

Run this code to see what it prints. Feel free to edit!

Construct a function that returns the max value from a list. If there are no items in alist``return ``None.

Run this code to see what it prints. Feel free to edit!

Construct a function that returns the average of the values entered into the list.

If you worked in a group, you can copy the answers from this page to the other group members. Select the group members below and click the button to share the answers.

The Submit Group button will submit the answer for each each question on this page for each member of your group. It also logs you as the official group submitter.

You have attempted of activities on this page