String Lab
Strings are immutable sequences of characters. Visualize indexing, slicing, and transformations in real-time.
Operations
Snippet
String State
s = "..."Logic Insight
Python strings are sequences of Unicode characters.
- • Immutability: You cannot change a character in place. `s[0] = 'x'` is an error.
- • Methods: String methods always return a new string object.
- • Indexing: Negative indices count from the end (e.g., -1 is the last char).
Memory State
Strings in Python are pre-allocated and cached when short.