Python String Methods
Multiple Choice Easy
Question
What does `' hello '.strip().upper()` return?
Hint
Methods are applied left to right.
Explanation
First .strip() removes leading and trailing whitespace, giving 'hello'. Then .upper() converts to uppercase, giving 'HELLO'. String methods are chained left to right, each operating on the result of the previous.
Related Resources
Related Lessons
- Strings
String methods.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.