Strings
Strings are sequences of characters, used for text. They can be created with single or double quotes.
Creating Strings
Loading Python Playground...
String Concatenation
Loading Python Playground...
Exercises
Loading Python Exercise...
Loading Python Exercise...
Loading Python Exercise...
String Indexing
Strings are sequences - access characters by index (starting at 0):
Loading Python Playground...
Loading Python Exercise...
Loading Python Exercise...
String Slicing
Extract portions of a string with [start:end]:
Loading Python Playground...
Loading Python Exercise...
Loading Python Exercise...
Escape Characters
Loading Python Playground...
Practice Playground
Loading Python Playground...
Key Takeaways
- Strings use single
'...'or double"..."quotes - Concatenate with
+, repeat with* - Index from 0 (or -1 from end)
- Slice with
[start:end:step] len()returns string length- Strings are immutable (cannot change in place)

