Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

String Manipulation | Python Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. Python Fundamentals

Lesson 18 of 55

·Python

String Manipulation

20 minutes

Course progress33%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • Strings are immutable; methods return new strings.
  • Slice with `string[start:stop:step]`.
  • Use f‑strings (`f'Hello {name}'`) for readable interpolation.
  • Common methods: `.lower()`, `.upper()`, `.strip()`, `.split()`, `.replace()`.

String Manipulation

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.

Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Python FundamentalsBrowse activities
Previous lessonData Structures – DictionariesContinue to lesson 19File I/OBack to Python Fundamentals curriculum