Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Concatenation and Basic Strings

String concatenation

All topicsPractise exam questions
Knowledge organiser

Concatenation and Basic Strings

301.5a

Join multiple strings.

What you need to know

Concatenation means joining strings together using the + operator. Both sides must be str type — if one is a number, you must cast it first.

Key points

  • + joins two strings: "Hello" + " World" → "Hello World"
  • Both sides must be str type
  • No automatic space — add it yourself
  • Use str() to convert numbers before joining

Code examples

String concatenation
python
first = "Hello"
second = "World"
print(first + " " + second)  # Hello World