Skip to main content
Loading page…
Python Mastery
Chapter 3
Lesson 2 of 4
Indexing & Slicing
Contents
Notes
Tutor
Concept
Indexing: Accessing Individual Characters
Loading activity…
Previous
1 / 8
Continue
Contents
Notes
Discussion
Tutor
22 min
8 activities
0 of 8 done
In this lesson
1
Indexing: Accessing Individual Characters
2
Slicing: Extracting Substrings
3
Slicing in Practice: Parsing a Date String
4
Predict the Slice
5
Gotcha: stop Is Exclusive
6
Reverse Words Using Slicing
7
Explain Negative Indices
8
Pro Tip: Slicing vs Indexing for Safety
Objectives
Learner can retrieve individual characters using positive and negative indices
Learner can extract substrings using start, stop, and step in slice notation
Learner can reverse a string with [::-1]
Learner can predict the difference between an out-of-range index error and a safe slice
Chapter 3 · Working with Strings
String Basics & Immutability
Indexing & Slicing
Essential String Methods
f-strings & Formatting
Previous: String Basics & Immutability
Next: Essential String Methods