Lesson 18 of 55
PythonString Manipulation
20 minutes
Course progress33%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 18 of 55
Python20 minutes
Keep these ideas in mind as you work through the lesson.
Strings are immutable sequences of Unicode characters. Python offers powerful slicing, formatting, and a rich set of methods.
msg = 'Hello, World!'
print(msg.upper()) # HELLO, WORLD!
print(msg[7:12]) # World
# f‑strings (Python 3.6+) for clean interpolation
name = 'Alice'
print(f'Hi, {name}!')
Because strings are immutable, operations like upper() return a new string rather than modifying the original.