Section 1/6What are Strings?
What are Strings?
Explore this concept
String Manipulation & Indexing
Strings are fundamental for working with text in Python. Understanding indexing and slicing is crucial for text processing and manipulation.
What are Strings?
message = "Python"print(len(message)) # → 6
→
6Strings are immutable sequences of Unicode characters. They can be:
- Indexed:
message[0] → 'P' - Sliced:
message[2:5] → 'tho' - Concatenated:
"Py" + "thon"