CHAPTER 11   •   PYTHON

Python String Methods

Learn common methods used to manipulate strings.

01 What is this?

Learn common methods used to manipulate strings.

02 Syntax

Python Syntax
text.upper()

03 Example

Python Example
text = 'hello python'

print(text.upper())
print(text.lower())
print(text.title())

04 Important Points

String methods return modified versions of strings.

05 Common Mistakes

Remember that most string methods do not modify the original string.

06 Real World Use

String methods are useful in search, forms and text processing.

07 Practice This Topic

Now try the example yourself in the AIFA Python Editor.

  • Read the example carefully.
  • Change the values.
  • Run the code.
  • Observe the output.
  • Try creating your own example.
Try It Yourself →