Skip to content

Latest commit

Β 

History

History
42 lines (33 loc) Β· 757 Bytes

File metadata and controls

42 lines (33 loc) Β· 757 Bytes

Lesson 8: Strings in Depth βœ‚οΈ

Welcome to Lesson 8! Let's master strings β€” text data. Manipulate, slice, and format them!

πŸ”€ String Basics

Strings are just text in quotes:

name = "Alex"

βœ‚οΈ Slicing and Indexing

Get parts of strings:

word = "Python"
print(word[0])      # 'P'
print(word[2:5])    # 'tho'

πŸ”„ String Methods

Useful tools:

  • .upper(), .lower(), .title(), .replace(), .find(), .split()
msg = "hello world"
print(msg.upper())

🎨 Formatting

Combine with variables:

name = "Alex"
age = 15
print(f"My name is {name} and I'm {age}")

🎯 Key Takeaways

βœ… Strings hold text βœ… Slice, change, and format strings βœ… Tons of built-in tools!