Quiz on Python String Exercises



1. What method would you use to convert a string to lowercase in Python?
2. Which method can be used to find the length of a string?
3. How can you check if a substring exists within a string?
4. What will be the output of 'Hello'.replace('l', 'p')?
5. Which method is used to remove whitespace from both ends of a string?

Advertisements