Skip to main content

Section 16.14 Review - Strings

Practice indexing, slicing, concatenation, repetition, and common string methods.

Subsection 16.14.1 Part A: Read the String

Checkpoint 16.14.1.

word = "computer"
Identify the first character, the last character, the character at index 3, and the length of the string.

Subsection 16.14.2 Part B: Predict the Result

Subsection 16.14.3 Part C: Match the Method

Checkpoint 16.14.3.

Match each method to what it does: lower(), upper(), strip(), replace(), find().

Subsection 16.14.4 Part D: Fix

Checkpoint 16.14.4.

The code below has an error. Update it so it runs correctly.

Checkpoint 16.14.5.

The code below has an error. Update it so it runs correctly.

Checkpoint 16.14.6.

The code below has an error. Update it so it runs correctly.

Subsection 16.14.5 Part E: Create

Checkpoint 16.14.7.

Using name = "Jordan", write code that creates and prints the string β€œHello, Jordan!”. Then write code that prints only the first three letters of the name.

Subsection 16.14.6 Think About ...

Checkpoint 16.14.8.

How are strings similar to lists? How are they different?
You have attempted of activities on this page.