← Back to blog Python

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

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.

Try these string tricks.

Run the examples in our free Python IDE.

Open the Python IDE →

Practise strings with feedback

Solve auto-marked string challenges in your browser.

Try the challenges →