Practice Useful String Methods - 7.4 | Strings in Python | Python Programming Language
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Useful String Methods

7.4 - Useful String Methods

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What does the lower() method do?

💡 Hint: Look at how 'HELLO' and 'hello' are different.

Question 2 Easy

Explain what strip() accomplishes on a string.

💡 Hint: Consider what happens when you have extra spaces.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the method lower() do?

Converts to uppercase
Converts to lowercase
Removes whitespace

💡 Hint: Think about lower case letters.

Question 2

True or False: The strip() method removes spaces from the middle of the string.

True
False

💡 Hint: Consider where spaces are removed.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a function that takes a string with spaces, replaces all spaces with hyphens, and converts it to lowercase.

💡 Hint: Think about using both replace and lower methods.

Challenge 2 Hard

Write code to count how many times 'apple' appears in 'apple banana apple'.

💡 Hint: What method counts occurrences of substrings?

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.