Skip to content

Oct 28: String Slicing, Methods

Meet in EnGeo 2208

Learning Objectives

After today's class, you should be able to:

  • Explain the syntax and meaning of slice operations, with and without indexes.
  • Name four methods that strings provide, and describe what each method does.
  • Describe where to find the official documentation for methods of built-in types.

Lesson Outline

Presentation [10 min]

  • Slicing a string and review of string methods

Mini Lecture [25 min]

  • String methods: strip(), split(), join()
  • Practice reading and parsing data from files

Q1–Q3 [15 min]

  1. Expression type and value
  2. Ranges and list loops
  3. List contents/methods

Your To-Do List

  • Prepare to retake Quiz 3 (4–6)
  • Required before Friday's class:
    • Read Chapter 8 of Python for Everyone (mayfield1)
    • Section 8.1 Persistence to Section 8.10 Summary
    • Do every activity and mark each section as completed
  • Required before Monday's class: