Python String Manipulation: A Beginner's Guide
June 19, 2026
Text in programming is called a string. Being able to manipulate strings — join them, slice them, change their case — is a core GCSE skill. This guide walks through the techniques you need with runnable examples.
Length of a string
word = "computer"
print(len(word)) # 8
Accessing characters (indexing)
Each character has a position starting from 0:
word = "computer"
print(word[0]) # c
print(word[-1]) # r (last character)
Slicing
Take part of a string with [start:stop] (stop is not included):
word = "computer"
print(word[0:4]) # comp
Changing case
name = "Alice"
print(name.upper()) # ALICE
print(name.lower()) # alice
Joining strings (concatenation)
first = "Bright"
second = "Revision"
print(first + second) # BrightRevision
Useful string methods
.strip()— remove spaces from the start and end.replace("a", "b")— swap one substring for another.find("x")— find the position of a characterstr(number)— turn a number into a string so you can join it
Strings are easiest to learn by experimenting. Open the free online Python IDE, store your own name in a variable, and try every method above on it.