Overview

Lists and strings are two kinds of sequences that have some similar functionality in Python. Today’s focus will be on using these two types of sequences.

Basic Learning Objectives

Before class, you should be able to:

  • Create a list in Python
  • Create a string in Python
  • Identify the syntax for indexing into, slicing, and concatenating sequences

Advanced Learning Objectives

After class, you should be able to:

  • Use the functionality of strings and lists to solve problems

Readings

You should complete the following readings/videos and embedded checks in Runestone:

Checks

Submit answers to the following on Moodle:

  • What will the output be for the following code? (Checkpoint 8.10.1)
      let = "z"
      let_two = "p"
      c = let_two + let
      m = c*5
      print(m)
    
  • Write a program that extracts the last three items in the list sports and assigns it to the variable last. Make sure to write your code so that it works no matter how many items are in the list. (Checkpoint 8.10.2)